body,
html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

#carousel-container {
    position: relative;
    width: 100vw;
    height: 100vh;

}

.media-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 1;
    will-change: opacity;
    /* Hint to optimize rendering */
    transform: translateZ(0);
    /* Force hardware acceleration */
    animation: fadeIn 1.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-out {
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

/* 
.media-element.fade-in {
    opacity: 1;
    transition: opacity 6s ease-in-out;
    z-index: 2;
    background-color: #000;
    ;
} */
/* Add this to ensure no flickering */
@media screen and (max-width: 767px) {
    .media-element {
        transition: opacity 2s ease-in-out;
        /* Shorter transition on mobile */
    }
}