:root {
    --primary-color: #ff3366;
    --secondary-color: #7a00ff;
    --bg-color: #0f0c29;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Dynamic Background Blob Animation */
.background-animation {
    position: absolute;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: drift 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--primary-color);
    animation-duration: 25s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: var(--secondary-color);
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 10vh) scale(1.2); }
}

.app-container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: auto;
    padding-top: 80px;
    padding-bottom: 80px;
}

header {
    text-align: center;
    animation: fadeInDown 1s ease-out;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

header h1 span {
    color: transparent;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.8;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: fadeInUp 1s ease-out;
}

/* Visualizer */
.visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 60px;
    width: 100%;
}

.bar {
    width: 8px;
    background: linear-gradient(to top, var(--secondary-color), var(--primary-color));
    border-radius: 4px;
    height: 10px;
    transition: height 0.1s ease;
}

.visualizer.active .bar {
    animation: bounce 1.2s ease infinite alternate;
}

.visualizer.active .bar:nth-child(1) { animation-delay: 0.1s; }
.visualizer.active .bar:nth-child(2) { animation-delay: 0.3s; height: 30px; }
.visualizer.active .bar:nth-child(3) { animation-delay: 0.0s; height: 50px; }
.visualizer.active .bar:nth-child(4) { animation-delay: 0.5s; height: 20px; }
.visualizer.active .bar:nth-child(5) { animation-delay: 0.2s; height: 40px; }
.visualizer.active .bar:nth-child(6) { animation-delay: 0.6s; height: 60px; }
.visualizer.active .bar:nth-child(7) { animation-delay: 0.3s; height: 25px; }
.visualizer.active .bar:nth-child(8) { animation-delay: 0.1s; height: 45px; }
.visualizer.active .bar:nth-child(9) { animation-delay: 0.4s; height: 35px; }
.visualizer.active .bar:nth-child(10) { animation-delay: 0.2s; height: 20px; }

@keyframes bounce {
    0% { height: 10px; }
    100% { height: 100%; }
}

/* Station Info */
.station-info {
    text-align: center;
    width: 100%;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 51, 102, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff3366;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.blinking-dot {
    width: 8px;
    height: 8px;
    background-color: #ff3366;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.station-info h2 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 5px;
    color: #aaa;
}

#stream-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), inset 0 -3px 0 rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 5px;
}

.control-btn.playing {
    padding-left: 0;
}

.control-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 25px rgba(0,0,0,0.4), inset 0 -3px 0 rgba(0,0,0,0.2);
}

.control-btn:active {
    transform: translateY(2px) scale(0.95);
    box-shadow: 0 5px 10px rgba(0,0,0,0.3), inset 0 0px 0 rgba(0,0,0,0.2);
}

/* Volume */
.volume-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 0 20px;
    color: #aaa;
}

#volume-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

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

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Channel Logo */
.channel-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    background-color: white; 
    padding: 0;
    margin-bottom: 5px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Screen reader only utility class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Live Clock */
.live-clock {
    font-size: 2.2rem;
    font-weight: 200;
    font-variant-numeric: tabular-nums; /* prevents text jitter when ticking */
    letter-spacing: 3px;
    margin-bottom: 10px;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Player UI Layout constraint */
.player-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
}

/* Desktop Optimization Layout */
@media (min-width: 800px) {
    .app-container {
        max-width: 1000px;
    }
    
    .glass-panel {
        flex-direction: row;
        align-items: center;
        padding: 50px 60px;
        gap: 60px;
    }
    
    .logo-section {
        flex: 1.2;
        display: block;
        text-align: center;
    }
    
    .channel-logo {
        width: 400px;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }
    
    .player-ui {
        flex: 1;
        gap: 25px;
    }
}

/* Top Announcement Bar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 8, 30, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    text-align: center;
    padding: 12px 15px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.topbar-text {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--primary-color), #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.topbar-sub {
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: #ccc;
    text-transform: uppercase;
}

@media (min-width: 800px) {
    .topbar {
        padding: 15px 0;
    }
    .topbar-text {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
    .topbar-sub {
        font-size: 0.9rem;
    }
}

/* Social Links */
.social-links {
    text-align: center;
    z-index: 100;
    margin-top: -10px; /* Pulls it slightly closer to the unit */
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.social-links a i {
    font-size: 1.2rem;
    color: #1877F2;
    background: #fff;
    border-radius: 50%;
}

/* Footer Copyright */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 0.75rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
    z-index: 100;
    letter-spacing: 1px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4), transparent);
}

/* Mobile Compact Layout adjustments */
@media (max-width: 600px), (max-height: 750px) {
    .glass-panel {
        padding: 30px 20px;
        gap: 20px;
    }
    .player-ui {
        gap: 20px;
    }
    .channel-logo {
        max-width: 180px;
    }
    .app-container {
        gap: 20px;
    }
}
