:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --spotify-green: #1DB954;
    --christmas-red: #b20710;
    --font-main: 'Inter', sans-serif;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, background-color 0.5s ease;
    padding: 20px;
    box-sizing: border-box;
}

.slide.active {
    opacity: 1;
    pointer-events: all;
}

.content {
    z-index: 10;
    max-width: 600px;
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 0.2em;
    line-height: 1.1;
}

h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

p.stat {
    font-size: 2rem;
    font-weight: 700;
    margin: 20px 0 5px;
}

p.sub-stat {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 0;
}

.visual,
.visual-box,
.visual-grid,
.graph-visual,
.unicorn-visual {
    font-size: 5rem;
    margin: 30px 0;
}

/* Specific Slide Styles */
#slide-2 .visual-box {
    position: relative;
    display: inline-block;
}

.bounding-box {
    border: 3px solid #00ff00;
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    animation: pulse-border 2s infinite;
}

.bounding-box .label {
    background: #00ff00;
    color: black;
    font-size: 0.8rem;
    position: absolute;
    top: -25px;
    left: -3px;
    padding: 2px 5px;
    font-weight: bold;
}

#slide-4 .stats-list {
    list-style: none;
    padding: 0;
    text-align: left;
    font-size: 1.5rem;
    margin: 0 auto;
    display: inline-block;
}

#slide-4 .stats-list li {
    margin-bottom: 15px;
}

/* Image Visuals */
.visual-img {
    max-width: 80%;
    max-height: 40vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 2rem 0;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-pulse-slow {
    animation: pulseSlow 4s ease-in-out infinite;
}

@keyframes pulseSlow {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.animate-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.animate-pop {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(0.5);
}

.animate-slide-in {
    animation: slideInLeft 0.6s ease forwards;
    opacity: 0;
    transform: translateX(-50px);
}

.animate-grow {
    animation: growBar 1s ease forwards;
    transform-origin: bottom;
    opacity: 0;
    /* logic handled in keyframes usually, but keeping simple */
    animation: popIn 1s forwards;
    /* Reusing pop for simplicity */
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.6s;
}

.delay-3 {
    animation-delay: 1.0s;
}

.delay-4 {
    animation-delay: 1.4s;
}

.delay-5 {
    animation-delay: 1.8s;
}

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

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-border {
    0% {
        border-color: #00ff00;
    }

    50% {
        border-color: transparent;
    }

    100% {
        border-color: #00ff00;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Buttons */
button {
    background: white;
    color: black;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 30px;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

.cta-btn {
    background: var(--spotify-green);
    color: white;
}

/* Snow */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

/* Video Controls */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 100;
}

.progress_bar {
    height: 100%;
    background: white;
    width: 0%;
}

.play-btn {
    background: white;
    color: black;
    font-size: 1.5rem;
    padding: 20px 50px;
    margin-top: 40px;
}

/* Navigation Controls */
.nav-controls {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    box-sizing: border-box;
    z-index: 200;
    pointer-events: none;
    /* Let clicks pass through if sticking out */
}

.nav-btn {
    pointer-events: all;
    background: #ffffff;
    /* Pure white for max contrast */
    color: #121212;
    /* Dark text */
    font-size: 1rem;
    /* Smaller text */
    font-weight: 800;
    /* Extra bold */
    padding: 10px 20px;
    /* Much smaller button */
    border-radius: 50px;
    /* Pill shape = less clunky */
    border: none;
    /* Remove border for cleaner look */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Stronger shadow for lift/visibility */
    transition: all 0.2s ease;
    margin-top: 0;
    /* Override generic button margin */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-btn:hover {
    background: #ffffff;
    transform: scale(1.05);
}

.nav-btn:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

/* Music Control */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.intro-img {
    max-height: 55vh;
    /* Slightly larger for the intro */
    max-width: 90%;
    object-fit: contain;
    background: transparent;
    box-shadow: none;
    /* Remove box shadow if the PNG has transparency or looks better without */
}

/* Slide 5 Specific Adjustments */
#slide-5 .visual-img {
    max-height: 80vh;
    /* Make image very large */
    max-width: 95vw;
    margin: 10px 0;
}

#slide-5 h2 {
    font-size: 2rem;
    margin-bottom: 5px;
}

#slide-5 .content {
    max-width: 95vw;
}



/* Slide 4 Specific Adjustments */
#slide-4 .content {
    max-width: 95vw;
    /* Allow full width for horizontal layout */
}

#slide-4 h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    line-height: 1.1;
}

#slide-4 .visual-img {
    max-height: 65vh;
    /* Large but leaves room */
    max-width: 90%;
    margin: 10px 0;
}

#slide-4 .stats-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    font-size: 1.1rem;
    /* Smaller readable text */
    margin-top: 5px;
    width: 100%;
}

#slide-4 .stats-list li {
    margin-bottom: 0;
}

/* Slide 6 (BRP) Specific */
#slide-6 .visual-img {
    max-height: 75vh;
    max-width: 90%;
    margin: 20px 0;
}

/* Slide 7 (Linköping) Specific */
#slide-7 .visual-img {
    max-height: 75vh;
    max-width: 90%;
    margin: 20px 0;
}

/* Slide 8 (The Future) */

/* Slide 9 (Outro) Specific Adjustments (Was Slide 8) */
#slide-9 h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

#slide-9 h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

#slide-9 .visual-img {
    max-height: 75vh;
    /* Even larger */
    margin: 5px 0;
    transform: scale(2.8);
    /* Zoom out slightly */
    transform-origin: center center;
}

#slide-9 .replay-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 201;
    /* Above nav */
    margin: 0;
    padding: 20px 50px;
    font-size: 1.2rem;
}

/* Fireworks */
.firework-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    animation: explode 1s ease-out forwards;
    z-index: 50;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* =========================================
   Responsive Design & Mobile Adaptation
   ========================================= */

/* Laptop/Short Screens (max-height: 800px) */
@media (max-height: 800px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }

    .visual-img {
        max-height: 50vh;
        margin: 10px 0;
    }

    /* Ensure content doesn't touch edges */
    .content {
        padding-top: 20px;
    }
}

/* Mobile Devices (Portrait) */
@media (max-width: 768px) {

    /* General Typography */
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    p.stat {
        font-size: 1.5rem;
    }

    .content {
        width: 90%;
        max-width: 100%;
        padding: 0 10px;
    }

    /* Adjust Images for Mobile */
    .visual-img {
        max-width: 95%;
        max-height: 40vh;
        /* Don't take up full vertical space on phone */
        transform: none !important;
        /* Reset extreme zooms on mobile to fit screen */
    }

    /* Specific Slide Overrides for Mobile */

    #slide-4 .stats-list {
        flex-direction: column;
        /* Stack stats vertical on mobile */
        gap: 10px;
    }

    #slide-4 .visual-img {
        max-height: 40vh;
    }

    #slide-5 .visual-img,
    #slide-7 .visual-img,
    /* Linköping */
    #slide-9 .visual-img {
        /* Outro */
        max-height: 45vh;
        transform: none;
        /* Disable zoom on mobile */
    }

    /* Navigation - Make touch friendly and avoid overlap */
    .nav-controls {
        bottom: 20px;
        padding: 0 20px;
    }

    .nav-btn {
        padding: 15px 25px;
        font-size: 1.2rem;
    }

    /* Replay button position */
    #slide-9 .replay-btn {
        width: 80%;
        bottom: 100px;
        /* Move up to avoid overlap with nav if visible */
    }
}