@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --accent-pink: #ec4899;
    --success: #10b981;
    --background: #0f0f1e;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
    --glow: 0 0 40px rgba(99, 102, 241, 0.4);
    --glow-secondary: 0 0 40px rgba(139, 92, 246, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- ANIMATED BACKGROUND --- */
.animated-bg {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at top left, #1a1a3e 0%, #0f0f1e 50%, #050510 100%);
    z-index: -2;
}

.animated-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.winter-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: glow-pulse 8s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.snowfall {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.snowflake {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(200, 220, 255, 0.3) 100%);
    border-radius: 50%;
    opacity: 0.6;
    animation: snowfall-fall var(--duration) linear infinite;
}

@keyframes snowfall-fall {
    0% { transform: translateY(-100vh) translateX(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.4; }
    100% { transform: translateY(100vh) translateX(var(--drift)); opacity: 0; }
}

/* --- LAYOUT --- */
.app-container {
    display: grid;
    grid-template-areas: 
        "header header"
        "player sidebar";
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    min-height: 100vh;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* --- HEADER --- */
.app-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    opacity: 0.5;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.brand-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    color: white;
    font-size: 1.75rem;
    box-shadow: var(--glow);
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.brand-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Space Grotesk', sans-serif;
}

.brand-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.time-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.time-widget .time {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--accent);
    font-family: 'Space Grotesk', monospace;
}

.time-widget .date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.6);
}

/* --- MAIN PLAYER --- */
.main-controls {
    grid-area: player;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.main-controls::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: rotate-gradient 20s linear infinite;
}

@keyframes rotate-gradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.controls-header {
    text-align: center;
    position: relative;
    z-index: 1;
}

.radio-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -1px;
    line-height: 1.1;
}

.radio-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* --- LYRICS --- */
.lyrics-container {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.lyrics-container.show {
    opacity: 1;
    max-height: 250px;
}

.lyrics-display {
    height: 180px;
    overflow: hidden;
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lyrics-line {
    padding: 0.5rem 0;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.34, 0.64, 0.64, 1);
    opacity: 0.3;
    transform: translateY(20px);
    font-weight: 400;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyrics-line.active {
    color: var(--accent);
    opacity: 1;
    transform: translateY(0) scale(1.15);
    font-weight: 700;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
    font-size: 1.5rem;
}

.lyrics-line.past {
    opacity: 0.2;
    color: var(--primary);
    transform: translateY(-15px);
}

.lyrics-line.upcoming {
    opacity: 0.4;
    color: var(--text-secondary);
    transform: translateY(15px);
}

.lyrics-line.hidden {
    display: none;
}

.lyrics-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--background));
    pointer-events: none;
    z-index: 2;
}

.no-lyrics {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.5;
}

/* --- PROGRESS BAR --- */
.progress-section {
    position: relative;
    z-index: 1;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--glass);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    cursor: pointer;
    position: relative;
}

.progress-bar-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    border-radius: 4px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: 'Space Grotesk', monospace;
    font-weight: 500;
}

/* --- PLAYBACK CONTROLS --- */
.playback-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.play-pause-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.play-pause-button::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: button-shine 3s linear infinite;
}

@keyframes button-shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.play-pause-button:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.8);
}

.play-pause-button:active {
    transform: scale(1.05);
}

.icon-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-pause-button i {
    position: absolute;
    transition: all 0.3s ease;
}

.play-pause-button i.hidden {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.play-pause-button i:not(.hidden) {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* --- VOLUME CONTROL --- */
.volume-section {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem;
    position: relative;
    z-index: 1;
}

.volume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.volume-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.volume-value {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
}

.volume-slider-container {
    position: relative;
    height: 12px;
}

.volume-track {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 3px;
    background: var(--glass);
    border-radius: 3px;
    overflow: hidden;
}

.volume-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.1s ease;
    border-radius: 3px;
}

.volume-slider {
    width: 100%;
    height: 12px;
    position: relative;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.volume-knob {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.1s ease;
    border: 2px solid var(--primary);
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: all 0.3s ease;
    cursor: default;
}

.stat-item:hover {
    background: var(--surface-hover);
    transform: translateY(-5px);
    box-shadow: var(--glow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.status-message {
    text-align: center;
    padding: 1.25rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    position: relative;
    z-index: 1;
}

/* --- SIDEBAR --- */
.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.now-playing-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: card-pulse 4s ease-in-out infinite;
}

@keyframes card-pulse {
    0%, 100% { box-shadow: var(--shadow-lg); }
    50% { box-shadow: var(--glow); }
}

.album-visualization {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.album-visualization::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.album-icon {
    font-size: 4.5rem;
    color: rgba(255, 255, 255, 0.9);
    z-index: 1;
    animation: spin-slow 25s linear infinite;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.track-info {
    padding: 2rem;
}

.track-status {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--primary);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.4); }
}

.track-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.4;
    font-family: 'Space Grotesk', sans-serif;
}

.listeners-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 16px;
    margin-top: 1.5rem;
}

.listeners-count {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.listeners-count i {
    color: var(--accent);
    font-size: 1.25rem;
}

.count-number {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.5rem;
}

.visualizer-container {
    position: relative;
    width: 100%;
    height: 80px;
    margin-top: 1.5rem;
    opacity: 0.8;
    border-radius: 12px;
    overflow: hidden;
}

/* --- ERROR & CONSTRUCTION --- */
.error-message {
    display: none;
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.25rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 1000;
    animation: slide-in 0.3s ease;
    backdrop-filter: blur(10px);
}

@keyframes slide-in {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.construction-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    z-index: 1001;
    display: none;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4);
}

.construction-banner.show {
    display: block;
    animation: banner-pulse 2s ease infinite;
}

@keyframes banner-pulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 10px 40px rgba(220, 38, 38, 0.6); }
}

.app-container.construction-mode {
    margin-top: 60px;
}

/* --- SUCKER THEME --- */
.sucker-theme {
    --primary: #0ea5e9;
    --secondary: #06b6d4;
    --accent: #fbbf24;
}

.sucker-theme .animated-bg {
    background: radial-gradient(ellipse at top, #1e3a8a 0%, #0f172a 60%, #020617 100%);
}

.sucker-theme .radio-title {
    animation: sucker-glow 2s ease-in-out infinite alternate;
}

@keyframes sucker-glow {
    0% { filter: drop-shadow(0 0 0 rgba(251, 191, 36, 0)); }
    100% { filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.8)); }
}

.floating-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    animation: float 12s linear forwards;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.7; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .app-container {
        grid-template-areas: 
            "header"
            "player"
            "sidebar";
        grid-template-columns: 1fr;
    }

    .sidebar {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
        gap: 1rem;
    }

    .app-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }

    .main-controls {
        padding: 2rem;
        gap: 2rem;
    }

    .radio-title {
        font-size: 2rem;
    }

    .play-pause-button {
        width: 85px;
        height: 85px;
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .album-visualization {
        height: 200px;
    }

    .album-icon {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .brand-text h1 {
        font-size: 1.25rem;
    }

    .radio-title {
        font-size: 1.75rem;
    }
}