/* Carousel Styles */
.carousel-container {
    position: relative;
    overflow: hidden;
    background-color: rgb(30, 58, 138); /* Fond bleu foncé par défaut */
    height: calc(100vh - 104px); /* 40px pour la barre du haut + 64px pour la navigation */
    margin-top: 0; /* On supprime la marge car la section est déjà après le menu */
}

.carousel-slide {
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    pointer-events: none;
    position: absolute;
    inset: 0;
    height: 100%;
    backface-visibility: hidden; /* Évite les scintillements */
    -webkit-backface-visibility: hidden;
    will-change: opacity; /* Optimise les performances */
}

.carousel-slide {
    display: none; /* Par défaut caché */
    align-items: center;
    height: 100%;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    display: flex;
}

.carousel-nav {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 0.75rem;
}

.carousel-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    padding: 0;
}

.carousel-dot.active {
    background-color: rgba(255, 255, 255, 0.8);
    width: 2rem;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    border: none;
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 1.5rem;
}

.carousel-next {
    right: 1.5rem;
}

.slide-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.3s;
}

.carousel-slide.active .slide-content {
    opacity: 1;
    transform: translateY(0);
}

/* Overlay gradient */
.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        rgba(30, 58, 138, 0.9) 0%,
        rgba(30, 58, 138, 0.8) 50%,
        rgba(30, 58, 138, 0.6) 100%
    );
    z-index: 1;
}

/* Image zoom effect */
.carousel-slide img {
    transform: scale(1.1);
    transition: transform 8s ease;
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    display: block;
    opacity: 0.99; /* Évite le scintillement sur certains navigateurs */
    -webkit-transform-style: preserve-3d; /* Aide à prévenir le scintillement */
    transform-style: preserve-3d;
    will-change: transform; /* Optimise les performances */
    min-height: 100%; /* Assure une hauteur minimale */
}

.carousel-slide.active img {
    transform: scale(1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel-prev,
    .carousel-next {
        width: 2.5rem;
        height: 2.5rem;
    }

    .carousel-prev {
        left: 1rem;
    }

    .carousel-next {
        right: 1rem;
    }

    .carousel-dot {
        width: 0.5rem;
        height: 0.5rem;
    }

    .carousel-dot.active {
        width: 1.5rem;
    }
}