/* ============================================================
   RADIO PLAYER — Sidebar widget, floating bar, mobile player
   ============================================================ */

/* ---- Sidebar Widget ---- */
.radio-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.radio-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f3f4f6;
}

.radio-widget__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.radio-widget__title svg {
    width: 16px;
    height: 16px;
    color: #7C3AED;
}

.radio-widget__live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: radio-live-pulse 1.5s ease-in-out infinite;
}

@keyframes radio-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.radio-widget__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.radio-widget__cover {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #7C3AED 0%, #a78bfa 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.radio-widget__cover svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.radio-widget__cover--playing {
    animation: radio-cover-spin 8s linear infinite;
}

@keyframes radio-cover-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radio-widget__info {
    text-align: center;
    width: 100%;
    min-width: 0;
}

.radio-widget__station {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 2px;
}

.radio-widget__desc {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.radio-widget__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.radio-widget__play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #7C3AED;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.radio-widget__play-btn:hover {
    background: #6d28d9;
    transform: scale(1.05);
}

.radio-widget__play-btn:active {
    transform: scale(0.95);
}

.radio-widget__play-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
    fill: #fff;
}

.radio-widget__volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.radio-widget__volume svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
    flex-shrink: 0;
}

.radio-widget__volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.radio-widget__volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #7C3AED;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.radio-widget__volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #7C3AED;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ---- Floating Bottom Player Bar ---- */
.radio-floating-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: #111827;
    border-top: 1px solid #1f2937;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

body.radio-active {
    padding-bottom: 64px;
}

body.radio-active .mobile-bottom-nav {
    bottom: 64px;
}

.radio-floating-bar.visible {
    transform: translateY(0);
}

.radio-floating-bar__cover {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #7C3AED 0%, #a78bfa 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.radio-floating-bar__cover svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.radio-floating-bar__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-floating-bar__station {
    font-size: 13px;
    font-weight: 700;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.radio-floating-bar__desc {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.radio-floating-bar__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.radio-floating-bar__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.radio-floating-bar__btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.radio-floating-bar__btn svg {
    width: 18px;
    height: 18px;
    color: #f9fafb;
}

.radio-floating-bar__play-btn {
    width: 40px;
    height: 40px;
    background: #7C3AED;
    border-radius: 50%;
}

.radio-floating-bar__play-btn:hover {
    background: #6d28d9;
}

.radio-floating-bar__volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.radio-floating-bar__volume svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.radio-floating-bar__volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: #374151;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.radio-floating-bar__volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #7C3AED;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1f2937;
}

.radio-floating-bar__volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #7C3AED;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1f2937;
}

/* ---- Mobile: Play button next to logo in header ---- */
.header-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-radio-btn {
    display: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #7C3AED;
    border: 2px solid #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.15s, background 0.2s;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
    flex-shrink: 0;
}

.header-radio-btn:active {
    transform: scale(0.9);
}

.header-radio-btn svg {
    width: 14px;
    height: 14px;
    color: #fff;
    fill: #fff;
}

.header-radio-btn--active {
    background: #ef4444;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: radio-live-pulse 1.5s ease-in-out infinite;
}

@media (max-width: 768px) {
    .header-radio-btn {
        display: flex;
    }
}

/* ---- Mobile: Vertical Slide-out Player ---- */
.radio-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.radio-mobile-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.radio-mobile-player {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: #111827;
    z-index: 9600;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.radio-mobile-player.visible {
    transform: translateX(0);
}

.radio-mobile-player__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #1f2937;
}

.radio-mobile-player__header-title {
    font-size: 14px;
    font-weight: 700;
    color: #f9fafb;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.radio-mobile-player__header-title svg {
    width: 16px;
    height: 16px;
    color: #7C3AED;
}

.radio-mobile-player__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.radio-mobile-player__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.radio-mobile-player__close svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
}

.radio-mobile-player__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    gap: 24px;
}

.radio-mobile-player__cover {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #7C3AED 0%, #a78bfa 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.radio-mobile-player__cover svg {
    width: 48px;
    height: 48px;
    color: #fff;
}

.radio-mobile-player__cover--playing {
    animation: radio-cover-spin 8s linear infinite;
}

.radio-mobile-player__info {
    text-align: center;
    width: 100%;
}

.radio-mobile-player__station {
    font-size: 18px;
    font-weight: 700;
    color: #f9fafb;
    margin: 0 0 4px;
}

.radio-mobile-player__desc {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

.radio-mobile-player__controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.radio-mobile-player__play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #7C3AED;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
}

.radio-mobile-player__play-btn:hover {
    background: #6d28d9;
    transform: scale(1.05);
}

.radio-mobile-player__play-btn:active {
    transform: scale(0.95);
}

.radio-mobile-player__play-btn svg {
    width: 28px;
    height: 28px;
    color: #fff;
    fill: #fff;
}

.radio-mobile-player__secondary-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.radio-mobile-player__secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.radio-mobile-player__secondary-btn svg {
    width: 20px;
    height: 20px;
    color: #f9fafb;
}

.radio-mobile-player__volume {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 200px;
}

.radio-mobile-player__volume svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    flex-shrink: 0;
}

.radio-mobile-player__volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: #374151;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.radio-mobile-player__volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #7C3AED;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1f2937;
}

.radio-mobile-player__volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #7C3AED;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1f2937;
}

/* ---- Equalizer animation (playing indicator) ---- */
.radio-eq {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.radio-eq__bar {
    width: 3px;
    background: #7C3AED;
    border-radius: 1px;
    animation: radio-eq-bounce 0.8s ease-in-out infinite;
}

.radio-eq__bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.radio-eq__bar:nth-child(2) { animation-delay: 0.15s; height: 12px; }
.radio-eq__bar:nth-child(3) { animation-delay: 0.3s; height: 6px; }
.radio-eq__bar:nth-child(4) { animation-delay: 0.1s; height: 14px; }

@keyframes radio-eq-bounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

/* ---- Loading spinner ---- */
.radio-loading {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: radio-spin 0.6s linear infinite;
}

@keyframes radio-spin {
    to { transform: rotate(360deg); }
}

/* ---- Desktop responsive (hide floating bar details on narrow screens) ---- */
@media (max-width: 768px) {
    .radio-floating-bar__volume {
        display: none;
    }

    .radio-floating-bar {
        padding: 8px 12px;
        gap: 10px;
    }
}

@media (min-width: 769px) {
    .header-radio-btn {
        display: none !important;
    }

    .radio-mobile-overlay,
    .radio-mobile-player {
        display: none !important;
    }
}
