:root {
    --bg-color: #0b0d13;
    --card-bg: rgba(22, 26, 38, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.35);
    --accent-hover: #4f46e5;
    --text-main: #f9fafb;
    --text-sub: #9ca3af;
    --live-color: #10b981;
    --live-glow: rgba(16, 185, 129, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 40%);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 16px;
}

/* Top Nav */
.nav-header {
    max-width: 960px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 18px;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.85;
}

.nav-brand .logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-brand .logo-icon svg,
.logo-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: #ffffff;
}


.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--card-border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--accent-glow);
}

/* Radio Card */
.radio-container {
    max-width: 960px;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
}

.station-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 14px;
}

.station-meta-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.station-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.station-header-desc {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.45;
    max-width: 620px;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--live-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 12px var(--live-glow);
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--live-color);
    border-radius: 50%;
    animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(1.35);
    }
}

.station-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.station-status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clock-badge {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    font-variant-numeric: tabular-nums;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Radio Deck / Main Console */
.radio-deck {
    background: linear-gradient(145deg, rgba(22, 26, 38, 0.95), rgba(15, 17, 24, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.08);
    border-radius: 20px;
    padding: 28px 24px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.radio-deck::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--live-color), transparent);
}

.deck-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.deck-art {
    position: relative;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.deck-art:hover {
    transform: scale(1.06);
}

.deck-art:active {
    transform: scale(0.96);
}

.deck-art:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.vinyl-disc {
    width: 84px;
    height: 84px;
    background: radial-gradient(circle, #2d3748 18%, #111827 22%, #1a202c 45%, #111827 50%, #2d3748 70%, #0f1117 72%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.deck-art:hover .vinyl-disc {
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45), inset 0 0 10px rgba(255, 255, 255, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.deck-art:hover .vinyl-disc.spinning {
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45), inset 0 0 10px rgba(255, 255, 255, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
}

.vinyl-disc.spinning {
    animation: spinVinyl 4s linear infinite;
}

@keyframes spinVinyl {
    100% {
        transform: rotate(360deg);
    }
}

.vinyl-center {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.vinyl-center svg {
    width: 17px;
    height: 17px;
    display: block;
    fill: #ffffff;
}

.deck-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deck-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-sub);
}

.deck-status-tag.live {
    color: var(--live-color);
}

.deck-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.deck-sub {
    font-size: 14px;
    color: var(--text-sub);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Radio Control Bar */
.radio-controls-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.25);
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-play-pause {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #ffffff;
    border: none;
    padding: 12px 26px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-play-pause:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
    filter: brightness(1.1);
}

.btn-play-pause.playing {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-play-pause.playing:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.play-icon {
    font-size: 15px;
    line-height: 1;
}

.pulse-cta {
    animation: pulseCta 2s infinite ease-in-out;
}

@keyframes pulseCta {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    }

    50% {
        box-shadow: 0 6px 30px rgba(99, 102, 241, 0.8), 0 0 15px rgba(99, 102, 241, 0.5);
        transform: scale(1.02);
    }
}

.deck-visualizer-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 22px;
    padding: 0 4px;
    flex-shrink: 0;
}

.deck-visualizer-container .viz-bar {
    width: 4px;
    background: linear-gradient(to top, var(--accent), var(--live-color));
    border-radius: 2px;
    height: 20%;
    transition: height 0.2s ease;
}

.deck-visualizer-container.active .viz-bar {
    animation: bounce 1.2s infinite ease-in-out alternate;
}

.deck-visualizer-container.active .viz-bar:nth-child(1) {
    height: 40%;
    animation-delay: 0.1s;
}

.deck-visualizer-container.active .viz-bar:nth-child(2) {
    height: 85%;
    animation-delay: 0.3s;
}

.deck-visualizer-container.active .viz-bar:nth-child(3) {
    height: 60%;
    animation-delay: 0.15s;
}

.deck-visualizer-container.active .viz-bar:nth-child(4) {
    height: 100%;
    animation-delay: 0.45s;
}

.deck-visualizer-container.active .viz-bar:nth-child(5) {
    height: 75%;
    animation-delay: 0.25s;
}

.deck-visualizer-container.active .viz-bar:nth-child(6) {
    height: 50%;
    animation-delay: 0.35s;
}

.deck-visualizer-container.active .viz-bar:nth-child(7) {
    height: 90%;
    animation-delay: 0.2s;
}

.deck-visualizer-container.active .viz-bar:nth-child(8) {
    height: 35%;
    animation-delay: 0.4s;
}

@keyframes bounce {
    0% {
        height: 20%;
    }

    100% {
        height: 100%;
    }
}

.deck-progress-container {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #10b981);
    border-radius: 4px;
    transition: width 0.3s linear;
}

.time-readout {
    display: flex;
    justify-content: flex-end;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    font-variant-numeric: tabular-nums;
}

/* Volume Box */
.volume-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.btn-vol {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--text-main);
    opacity: 0.85;
    transition: opacity 0.2s;
}

.btn-vol:hover {
    opacity: 1;
}

.volume-range {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent);
    transition: transform 0.1s;
}

.volume-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent);
}

.vol-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    min-width: 32px;
    font-variant-numeric: tabular-nums;
}

/* Metadata Grid */
.metadata-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
}

.meta-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.meta-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex-shrink: 0;
}

.meta-val {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: right;
    line-height: 1.4;
}

/* Footer */
.station-footer {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: var(--text-sub);
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.footer-legal-links a {
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-legal-links a:hover {
    color: var(--text-main);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e1b4b;
    color: #c7d2fe;
    border: 1px solid #4338ca;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .station-title {
        font-size: 20px;
    }

    .deck-top {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .deck-info {
        align-items: center;
        width: 100%;
    }

    .deck-title {
        font-size: 18px;
        text-align: center;
    }

    .deck-sub {
        text-align: center;
    }

    .radio-controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-play-pause {
        width: 100%;
    }

    .volume-box {
        justify-content: center;
    }

    .meta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .meta-val {
        text-align: left;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .metadata-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Listener Count Badge ─────────────────────────────────────── */
.listener-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 12px;
    font-weight: 600;
    color: var(--live-color);
    letter-spacing: 0.02em;
}

.listener-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live-color);
    box-shadow: 0 0 6px var(--live-color);
    animation: pulse-dot 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.75); }
}

/* ── Recently Played ──────────────────────────────────────────── */
.recently-played-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.recently-played-list {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.rp-empty {
    font-size: 13px;
    color: var(--text-sub);
    font-style: italic;
}

.rp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: rp-slide-in 0.3s ease forwards;
    opacity: 0;
    animation-delay: calc(var(--rp-i, 0) * 40ms);
}

@keyframes rp-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rp-index {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    min-width: 16px;
    text-align: center;
}

.rp-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
