/* --- CSS VARIABLES & BASE SETUP --- */
:root {
    --color1: #1db954;
    --color2: #191414;
    --color3: #535353;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: white;
    overflow: hidden;
    cursor: none; /* Kiosk / TV mode */

    /* Ambient animated gradient background */
    background: linear-gradient(
        135deg,
        var(--color1) 0%,
        var(--color2) 50%,
        var(--color3) 100%
    );
    background-size: 300% 300%;
    animation: gradientBG 25s ease-in-out infinite;
    transition: background 1.5s ease-in-out;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* --- TOP PROGRESS BAR & PAUSED LABEL --- */
#progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.28);
    transition: opacity 0.3s ease;
    z-index: 1;
}

#paused-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

/* --- CORNER METADATA (LEFT: TIME, RIGHT: WEATHER) --- */
#datetime-container {
    position: absolute;
    top: 40px;
    left: 40px;
    display: flex;
    flex-direction: column;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 50;
    pointer-events: none;
}

#time-display {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#date-display {
    font-size: 1.05rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}

#weather-container {
    position: absolute;
    top: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 50;
    pointer-events: none;
}

#weather-top {
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    gap: 12px;
    align-items: center;
}

#weather-location {
    font-size: 1.05rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}

/* --- MAIN APP CONTAINER --- */
#app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   1. CLASSIC MODE (NO LYRICS / FALLBACK / PAUSED)
   Exact match to original centered design
   ============================================================ */
body.mode-classic #app-container {
    align-items: center;
    justify-content: center;
}

body.mode-classic .media-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

body.mode-classic .art-wrapper {
    order: 2;
    margin-bottom: 25px;
}

body.mode-classic #cover-art {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    transition: transform 0.5s ease;
}

body.mode-classic .track-meta {
    display: contents;
}

body.mode-classic #track-title {
    order: 1;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    word-break: break-word;
}

body.mode-classic #artist-name {
    order: 3;
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.mode-classic .mini-progress-info,
body.mode-classic .lyrics-section {
    display: none;
}

/* ============================================================
   2. LYRICS MODE (TIME-SYNCED KARAOKE VIEW)
   Split view: Left Media Info | Right Scrolling Synced Lyrics
   ============================================================ */
body.mode-lyrics #app-container {
    display: grid;
    grid-template-columns: 460px 1fr;
    height: 100vh;
    padding: 100px 60px 40px 60px;
    gap: 40px;
    align-items: center;
}

/* --- Left Column: Media Information --- */
body.mode-lyrics .media-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    max-width: 440px;
    padding-left: 20px;
}

body.mode-lyrics .art-wrapper {
    order: 1;
    margin-bottom: 28px;
    width: 100%;
}

body.mode-lyrics #cover-art {
    width: 360px;
    height: 360px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 255, 255, 0.08);
}

body.mode-lyrics .track-meta {
    order: 2;
    width: 100%;
}

body.mode-lyrics #track-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 10px;
    text-transform: none;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.mode-lyrics #artist-name {
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.85;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.mode-lyrics .mini-progress-info {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

/* --- Right Column: Scrolling Lyrics Pane --- */
body.mode-lyrics .lyrics-section {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

#lyrics-container {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    
    /* Top & bottom smooth gradient fade masks */
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 1) 20%,
        rgba(0, 0, 0, 1) 80%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 1) 20%,
        rgba(0, 0, 0, 1) 80%,
        transparent 100%
    );
}

#lyrics-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

#lyrics-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
    /* Generous top & bottom padding so first and last lines can center */
    padding-top: 42vh;
    padding-bottom: 45vh;
    padding-left: 20px;
    padding-right: 40px;
}

/* Individual Lyric Line Styling */
.lyric-line {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.35);
    filter: blur(0.4px);
    transform: scale(0.96);
    transform-origin: left center;
    transition: 
        color 0.4s cubic-bezier(0.2, 0, 0, 1),
        font-size 0.4s cubic-bezier(0.2, 0, 0, 1),
        transform 0.4s cubic-bezier(0.2, 0, 0, 1),
        opacity 0.4s cubic-bezier(0.2, 0, 0, 1),
        filter 0.4s cubic-bezier(0.2, 0, 0, 1),
        text-shadow 0.4s cubic-bezier(0.2, 0, 0, 1);
    will-change: transform, color, opacity;
}

/* Active Highlight Line */
.lyric-line.active {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 900;
    filter: blur(0);
    transform: scale(1.05);
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        0 4px 15px rgba(0, 0, 0, 0.6);
}

/* Past / Sung Lines */
.lyric-line.past {
    color: rgba(255, 255, 255, 0.45);
    filter: blur(0.2px);
    transform: scale(0.98);
}

/* Responsive adjustments for smaller screens / vertical displays */
@media (max-width: 960px) {
    body.mode-lyrics #app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        padding: 80px 20px 20px 20px;
        gap: 20px;
    }

    body.mode-lyrics .media-container {
        align-items: center;
        text-align: center;
        max-width: 100%;
        padding-left: 0;
    }

    body.mode-lyrics #cover-art {
        width: 180px;
        height: 180px;
    }

    body.mode-lyrics #track-title {
        font-size: 1.6rem;
    }

    .lyric-line {
        font-size: 1.4rem;
        text-align: center;
        transform-origin: center center;
    }

    .lyric-line.active {
        font-size: 1.8rem;
    }
}

