/* Image Leaves Decoration */
.line-leaves {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 200px;
    pointer-events: none;
    z-index: 1000;
}

.line-leaves.left {
    left: 0;
}

.line-leaves.right {
    right: 0;
    transform: scaleX(-1); /* Mirror the right side */
}

.line-leaf {
    position: absolute;
    width: 150px;
    height: 150px;
    background-image: url('../img/lief4.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Position the leaves */
.line-leaf:nth-child(1) {
    top: 20%;
    left: 20px;
}

.line-leaf:nth-child(2) {
    top: 45%;
    left: 20px;
}

.line-leaf:nth-child(3) {
    top: 70%;
    left: 20px;
}

/* Single leaf animation */
@keyframes singleLeafShow {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) rotate(var(--rotate, 0deg));
    }
    2%, 14% {
        opacity: 0.9;
        transform: translateY(0) rotate(var(--rotate, 0deg));
    }
    16%, 98% {
        opacity: 0;
        transform: translateY(0) rotate(var(--rotate, 0deg));
    }
}

/* Hide all leaves by default */
.line-leaf {
    opacity: 0;
}

/* Base animation properties */
.line-leaf {
    animation: singleLeafShow 18s linear infinite;
}

/* Right side leaves */
.line-leaves.right .line-leaf:nth-child(1) {
    animation-delay: 0s;  /* 0-3s */
}
.line-leaves.right .line-leaf:nth-child(2) {
    animation-delay: 6s;  /* 6-9s */
}
.line-leaves.right .line-leaf:nth-child(3) {
    animation-delay: 12s; /* 12-15s */
}

/* Left side leaves */
.line-leaves.left .line-leaf:nth-child(1) {
    animation-delay: 3s;  /* 3-6s */
}
.line-leaves.left .line-leaf:nth-child(2) {
    animation-delay: 9s;  /* 9-12s */
}
.line-leaves.left .line-leaf:nth-child(3) {
    animation-delay: 15s; /* 15-18s */
}

/* Position and rotation for each leaf */
.line-leaf:nth-child(1) { --rotate: -15deg; }
.line-leaf:nth-child(2) { --rotate: 0deg; }
.line-leaf:nth-child(3) { --rotate: 15deg; }

/* Apply rotation to all leaves */
.line-leaf {
    transform: rotate(var(--rotate, 0deg));
}

/* Media queries for responsive behavior */
@media screen and (max-width: 1200px) {
    .line-leaves {
        width: 150px;
    }
    .line-leaf {
        width: 120px;
        height: 120px;
    }
}

@media screen and (max-width: 992px) {
    .line-leaves {
        width: 100px;
    }
    .line-leaf {
        width: 80px;
        height: 80px;
    }
}

@media screen and (max-width: 768px) {
    .line-leaves {
        display: none; /* Hide on mobile */
    }
}