/* =====================
   Parallax Effects
   ===================== */

/* Parallax scroll effect */
.carousel-container.parallax-enabled {
    overflow: hidden;
    position: relative;
}

.carousel-container.parallax-enabled .carousel-track {
    position: relative;
    z-index: 3;
}

/* Parallax background layers - full page */
.parallax-layer {
    position: fixed;
    top: -50vh;
    left: 0;
    width: 100%;
    height: 200vh;
    pointer-events: none;
    will-change: transform;
    z-index: -3;
}

/* Side buffer suppression zones - behind content */
.parallax-layer-midground::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.3) 40%,
            rgba(0, 0, 0, 0.1) 70%,
            transparent 100%
        ),
        linear-gradient(
            to right,
            rgba(0, 0, 0, 0.75) 0%,
            rgba(0, 0, 0, 0.5) 10%,
            rgba(0, 0, 0, 0.2) 20%,
            transparent 30%,
            transparent 70%,
            rgba(0, 0, 0, 0.2) 80%,
            rgba(0, 0, 0, 0.5) 90%,
            rgba(0, 0, 0, 0.75) 100%
        );
    z-index: 1;
    pointer-events: none;
}

.game-page {
    position: relative;
    z-index: 100;
}

.parallax-layer-background {
    z-index: -10;
}

.parallax-layer-midground {
    z-index: -5;
}

.parallax-layer-foreground {
    z-index: -3;
}

/* Background: Dark texture layer */
.parallax-layer-background {
    background: 
        /* Noise overlay */
        repeating-linear-gradient(
            0deg,
            rgba(30, 30, 35, 0.4) 0px,
            rgba(35, 35, 40, 0.4) 1px,
            rgba(30, 30, 35, 0.4) 2px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(28, 28, 33, 0.4) 0px,
            rgba(32, 32, 37, 0.4) 1px,
            rgba(28, 28, 33, 0.4) 2px
        ),
        /* Imperfections */
        radial-gradient(ellipse at 20% 30%, rgba(25, 25, 30, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(20, 20, 25, 0.5) 0%, transparent 50%),
        /* Base color */
        linear-gradient(to bottom, rgba(26, 26, 30, 0.5), rgba(32, 32, 36, 0.5));
    opacity: 0.5;
}

/* Midground: Parallax tile images */
.parallax-layer-midground {
    opacity: 0.8;
    padding: 0 10%;
}

.parallax-tile {
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    display: block;
}

.parallax-tile img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

/* Suppress text tiles so they don't distract */
.parallax-tile-text {
    opacity: 0.5;
    filter: brightness(0.7);
}

/* Foreground: Small sparks */
.parallax-layer-foreground {
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 200, 50, 0.3) 0%, transparent 2px),
        radial-gradient(circle at 80% 40%, rgba(255, 180, 60, 0.25) 0%, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 220, 80, 0.2) 0%, transparent 2px),
        radial-gradient(circle at 70% 80%, rgba(255, 150, 40, 0.25) 0%, transparent 1px),
        radial-gradient(circle at 30% 35%, rgba(255, 190, 50, 0.2) 0%, transparent 1px);
    background-size: 100% 150%;
    animation: sparksMove 3s linear infinite;
    opacity: 0.4;
}

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

/* Parallax effect on active slide */
.carousel-container.parallax-enabled .carousel-slide.active video,
.carousel-container.parallax-enabled .carousel-slide.active img {
    will-change: transform;
}

/* =====================
   Responsive Parallax
   ===================== */
@media (max-width: 768px) {
    /* Mobile parallax padding */
    .parallax-layer-midground {
        padding: 0 5%;
    }
    
    /* Adjust side buffers for mobile */
    .parallax-layer-midground::after {
        background: linear-gradient(
            to right,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(0, 0, 0, 0.4) 5%,
            rgba(0, 0, 0, 0.15) 15%,
            transparent 25%,
            transparent 75%,
            rgba(0, 0, 0, 0.15) 85%,
            rgba(0, 0, 0, 0.4) 95%,
            rgba(0, 0, 0, 0.7) 100%
        );
    }
}
