/* APMS Background Images CSS */

/* Base background color only for parallax background */
body[data-background="parallax"] {
    background-color: #1d1913;
}

/* Single APMS background image */
body[data-background="1"],
body[data-background="2"],
body[data-background="3"],
body[data-background="4"] {
    background-image: url('../img/backgrounds/apms-background.png'), url('../img/backgrounds/apms-background.jpg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

/* Dark overlay to reduce brightness */
body[data-background="1"]::before,
body[data-background="2"]::before,
body[data-background="3"]::before,
body[data-background="4"]::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
    pointer-events: none;
}

/* Parallax Background with Three Images */
body[data-background="parallax"] {
    position: relative;
    overflow-x: hidden;
    background: #1d1913;
    min-height: 100vh;
}

/* Container for the three background images */
.parallax-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;


/* Individual background image layers */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.9;
    filter: blur(2px);
    -webkit-filter: blur(2px);
}

/* First layer (top part) */
.parallax-layer-1 {
    background-image: url('../img/backgrounds/web_backround_desktop%201.png');
    transform: translateY(-30px) scale(1);
    opacity: 0.85;
}

.parallax-layer-2 {
    background-image: url('../img/backgrounds/web_backround_desktop%202.png');
    transform: translateY(10px) translateX(12vw) scale(0.60);
    opacity: 0.85;
}

/* Third layer (bottom part) */
.parallax-layer-3 {
    background-image: url('../img/backgrounds/web_backround_desktop%203.png');
    transform: translateY(60px) scale(1.0);
    opacity: 0.85;
}

/* Responsive adjustments for different screen sizes */
@media (min-width: 2560px) {
    .parallax-layer-2 {
        transform: translateY(10px) translateX(400px) scale(0.70);
    }
}

@media (max-width: 1920px) {
    .parallax-layer-2 {
        transform: translateY(10px) translateX(180px) scale(0.65);
    }
}

@media (max-width: 1600px) {
    .parallax-layer-2 {
        transform: translateY(10px) translateX(80px) scale(0.80);
    }
}

@media (max-width: 1366px) {
    .parallax-layer-2 {
        transform: translateY(10px) translateX(50px) scale(0.80);
    }
}

@media (max-width: 1024px) {
    .parallax-layer-2 {
        transform: translateY(10px) translateX(20px) scale(0.80);
    }
}

/* Zoom-based adjustments */
@media (min-resolution: 1.5dppx) {
    .parallax-layer-2 {
        transform: translateY(10px) translateX(250px) scale(0.80);
    }
}

@media (min-resolution: 2dppx) {
    .parallax-layer-2 {
        transform: translateY(10px) translateX(300px) scale(0.80);
    }
}

/* Scrolled state - images come together smoothly */
body[data-background="parallax"].scrolled .parallax-layer-1 {
    transform: translateY(-10px) scale(1.02);
    opacity: 0.9;
}

body[data-background="parallax"].scrolled .parallax-layer-2 {
    transform: translateY(0) scale(1);
    opacity: 0.9;
}

body[data-background="parallax"].scrolled .parallax-layer-3 {
    transform: translateY(10px) scale(1.05);
    opacity: 0.9;
}

/* Dark overlay for parallax background */
body[data-background="parallax"]::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 25, 19, 0.3);
    z-index: -1;
    pointer-events: none;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced overlay when scrolled */
body[data-background="parallax"].scrolled::before {
    background: rgba(29, 25, 19, 0.4);
}

/* Smooth fade-in animation for the parallax layers */
@keyframes fadeInParallax {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

.parallax-layer {
    animation: fadeInParallax 1.2s ease-out;
}

/* Ensure content is above the background */
.container, .navbar, .content-wrapper {
    position: relative;
    z-index: 1;
}
