/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');
/* Attempting BBH Bartle import */
@import url('https://fonts.googleapis.com/css2?family=BBH+Bartle&display=swap');

:root {
    --bg-color: #ffffff;
    --bg-color-alt: #f8f9fa;
    --text-color: #000000;
    --text-color-rgb: 0, 0, 0;

    /* New Palette */
    --color-cyan: #00ffcc;
    --color-lime: #ccff00;
    --color-dark-purple: #1a0b1a;
    --color-off-white: #f4f4f4;

    --accent-color: var(--color-cyan);
    --accent-color-rgb: 0, 255, 204;
    /* Default accent RGB */

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --spacing-unit: 8px;
    --header-height: 60px;
}

/* Dark Dark Theme */
body.dark-theme {
    --bg-color: #000000;
    --bg-color-alt: #080808;
    --text-color: #ffffff;
    --text-color-rgb: 255, 255, 255;
    --color-off-white: #111111;
}

/* Theme Toggle */
.theme-toggle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 16px;
    border: 1px solid #ddd !important;
    border-radius: 99px;
    margin-right: 12px;
    background: #eeeeee !important;
    /* Solid light grey for light mode */
    color: #000000 !important;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.dark-theme .theme-toggle {
    background: #222222 !important;
    /* Solid dark grey for dark mode */
    color: #ffffff !important;
    border-color: #444444 !important;
}

.theme-toggle:hover {
    background: var(--text-color) !important;
    color: var(--bg-color) !important;
}

/* Logo Inversion */
body.dark-theme .logo img {
    filter: invert(1);
}

body.dark-theme .nav-icon {
    color: var(--text-color) !important;
}

/* Volume Slider */
.volume-control {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 20;
    /* Ensure above other layers */
}

input[type=range].mini-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    /* Wider */
    height: 6px;
    /* Thicker track */
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    transition: opacity 0.2s;
    cursor: pointer;
}

input[type=range].mini-slider:hover {
    opacity: 1;
}

/* Chrome/Safari Thumb */
input[type=range].mini-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    /* Bigger thumb */
    height: 18px;
    background: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(var(--text-color-rgb), 0.1);
    margin-top: 0;
    /* Align */
}

/* Firefox Thumb */
input[type=range].mini-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--text-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

/* Typography */
.text-jumbo {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 0.95;
}

.text-mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 15px;
    /* Tighter gap */
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

/* Header - Thinner, Top Bar */
.site-header {
    background: var(--bg-color);
    padding: 10px 0;
    border-bottom: 1px solid rgba(var(--text-color-rgb), 0.1);
    position: sticky;
    top: 0;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'BBH Bartle', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.nav-icon:hover {
    opacity: 0.7;
}



/* Marquee - Now Bright Cyan, below header */
.marquee-bar {
    background-color: var(--accent-color);
    color: var(--bg-color);
    /* Default to contrast against accent */
    padding: 10px 0;
    overflow: hidden;
    font-family: var(--font-mono);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 1px solid var(--text-color);
}

.marquee-content {
    display: block;
    text-align: center;
    width: 100%;
}

/* Animation removed */

/* Fix top bar mobile overflow */
@media (max-width: 768px) {
    .marquee-bar {
        white-space: normal;
        padding: 8px 15px;
        text-align: center;
        line-height: 1.3;
    }

    .marquee-content {
        font-size: 0.85rem;
        display: inline;
    }
}

/* Hero Card - Dark Purple Noise */
.hero-section {
    padding: 20px 0;
}

.hero-card {
    background-color: var(--color-dark-purple);
    color: white;
    border-radius: 20px;
    padding: 0;
    /* Padding moved to hero-content */
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    /* Noise Simulation */
    background-image:
        radial-gradient(at 80% 0%, hsla(289, 28%, 35%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(255, 24%, 38%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(339, 26%, 44%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(297, 14%, 43%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(311, 10%, 36%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(296, 25%, 35%, 1) 0px, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 5;
    padding: 60px 40px;
    max-width: 800px;
}

body.dark-theme .hero-content {
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.5);
}

#heroDescription {
    font-weight: 500;
}

body.dark-theme #heroDescription {
    opacity: 1 !important;
}

.play-button-overlay {
    background: white;
    color: black;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.play-button-overlay:hover {
    transform: scale(1.1);
}

.hero-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.hero-controls .play-button-overlay {
    margin-top: 0;
}

/* Track Card Widget */
.track-card {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: var(--bg-color);
    color: var(--text-color);
    padding: 0;
    border-radius: 16px;
    display: flex;
    gap: 0;
    align-items: stretch;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    /* Fixed Dimensions for Square Art Stability */
    max-width: 400px;
    height: 160px;
    overflow: hidden;
    /* For mobile safety */
    z-index: 10;
    border: 1px solid rgba(var(--text-color-rgb), 0.1);
}

.art-wrapper {
    width: 160px;
    height: 100%;
    position: relative;
    background: #eee;
    flex-shrink: 0;
}

body.dark-theme .art-wrapper {
    background: #111;
}

.art-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    margin-left: -15px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
    z-index: 1;
}

body.dark-theme .art-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
}

.track-card img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 2;
    display: block;
}

.track-card img.loaded {
    opacity: 1;
}

.track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 20px 16px 16px;
    overflow: hidden;
    /* Ensure text doesn't break layout */
}


/* Track Info Styles */
.track-info .label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

/* Scrolling Track Title */
.track-title-mask {
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 4px;
}

.track-title-mask.mask-active {
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.track-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
    /* Removed clamp */
}

.is-scrolling {
    animation: scroll-pingpong 6s ease-in-out infinite alternate;
    padding-left: 0;
}

@keyframes scroll-pingpong {

    0%,
    15% {
        transform: translateX(0);
    }

    85%,
    100% {
        transform: translateX(var(--scroll-offset, -10px));
    }
}

.track-artist {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 12px;
}

.next-track-container {
    border-top: 1px solid rgba(var(--text-color-rgb), 0.1);
    padding-top: 8px;
    margin-top: 4px;
}

.next-track-text {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 4px;
    height: 1.25em;
    /* Fixed height to prevent resizing */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: opacity 0.3s ease;
}

/* Text Fade Animation */
.text-fade-out {
    opacity: 0;
}

.text-fade-in {
    opacity: 1;
}

/* Content Cards */
.card-grid {
    margin-top: 40px;
}

.card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

.card-img {
    width: 100%;
    aspect-ratio: 1/1;
    background: #ccc;
    object-fit: cover;
    border-radius: 12px;
}

.pill-tag {
    display: inline-block;
    border: 1px solid currentColor;
    border-radius: 9999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Big Footer */
.big-footer {
    margin-top: 0;
    padding: 20px 0 0;
    background: var(--bg-color);
    text-align: center;
}

.footer-logo {
    font-family: 'BBH Bartle', 'Inter', sans-serif;
    font-size: 18vw;
    /* Massive */
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.05em;
    display: block;
    margin-bottom: -20px;
    /* Hug bottom */
    position: relative;
    /* Ensure stacking context for canvas */
}

/* Schedule Layout */
.day-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.day-tab {
    padding: 8px 16px;
    border: 1px solid var(--text-color);
    opacity: 0.4;
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    white-space: nowrap;
    color: var(--text-color);
}

.day-tab.active {
    background: var(--text-color);
    color: var(--bg-color);
    opacity: 1;
}

.day-tab:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Removed old column/grid styles */

.current-program {
    background: rgba(var(--text-color-rgb, 0, 0, 0), 0.05);
    border-left: 4px solid var(--accent-color, var(--text-color));
}



/* Responsive */
@media (max-width: 768px) {
    .grid-12 {
        display: flex;
        flex-direction: column;
    }

    .hero-card {
        padding: 40px 20px !important;
        /* Increase top padding for better vertical balance */
        min-height: 60vh;
        /* Match PC height for consistency */
        justify-content: flex-start !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    .hero-content {
        padding: 0 !important;
        /* Content padding was causing double indentation */
        margin: 0 !important;
        width: 100%;
        text-align: left !important;
    }

    .hero-content * {
        text-align: left !important;
    }

    .track-card {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 40px;
        width: 100%;
        max-width: none;
        flex-direction: row;
        /* Keep image side-by-side or stack? Side is better */
        padding: 15px;
        background: #ffffff !important;
        /* Explicit default */
        color: #000000 !important;
        height: auto;
        border: 1px solid #ddd !important;
    }

    body.dark-theme .track-card {
        background: #111111 !important;
        /* Explicit dark mode color */
        color: #ffffff !important;
        border: 1px solid #333 !important;
    }

    .track-card img {
        width: 70px;
        height: 70px;
    }

    .track-title {
        font-size: 1.1rem;
    }

    .big-footer {
        margin-top: 60px;
    }

    .footer-logo {
        font-size: 22vw;
    }



    /* Mobile Navigation */

    .schedule-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Adjust Program Switcher for Mobile */
    .program-switcher {
        left: 50%;
        transform: translateX(-50%);
        bottom: 80px;
        /* Above Player Dock */
        width: 90%;
        max-width: 350px;
        padding: 10px;
    }



    .text-jumbo {
        font-size: clamp(2rem, 10vw, 3rem);
    }
}

/* Full Page Loader */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    /* White background */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    /* Light black/grey trail */
    border-radius: 50%;
    border-top-color: #000;
    /* Black spinner */
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loaded #loader-wrapper {
    opacity: 0;
    pointer-events: none;
}