/* ===== SERVICES CAROUSEL SECTION ===== */

.services-carousel-section {
    background: var(--navbar-bg-color);
    color: var(--text-color);
    /* Center the entire content block in the section */
    padding: 80px 20px;
    min-height: 100vh;
    position: relative;
    z-index: 10;
    font-family: 'Regular', sans-serif;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.services-carousel-section .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    /* Stack header and viewport and center them */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

/* Blurred dimmed background that mirrors the active slide */
.services-carousel-section .carousel-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden; /* Empêche le flou de déborder sur les sections voisines */
}

.services-carousel-section .carousel-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.25);
    transform: scale(1.06); 
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.services-carousel-section .carousel-bg-layer.active {
    opacity: 1;
}

/* Header */
.carousel-header {
    text-align: center;
    /* Use container gap for spacing */
    margin: 0;
}

.carousel-heading {
    font-family: 'Title', 'Exo 2', 'Arial', sans-serif;
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 20px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-stretch: expanded;
}

/* Carousel Viewport */
.carousel-viewport {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 20px;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    width: 100%;
    position: relative;
}

/* Carousel Slide */
.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 20px;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Image dans le slide */
.carousel-slide .slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Overlay pour l'image */
.carousel-slide .slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Gradient de bas vers haut pour contraster le texte sur l'image */
.carousel-slide .slide-overlay::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    background: var(--gradient-dark-overlay);
    pointer-events: none;
}

/* Texte sur l'image */
.carousel-slide .slide-title {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: 'Raustila', serif;
    font-size: 3rem;
    color: var(--text-color);
    text-align: center;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
}

/* États des slides */
.carousel-slide {
    opacity: 0;
    transform: translateX(100%) scale(0.8);
    filter: brightness(0.5);
    z-index: 1;
}

.carousel-slide.prev {
    opacity: 0.5;
    transform: translateX(-80%) scale(0.85);
    filter: brightness(0.6);
    z-index: 2;
}

.carousel-slide.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: brightness(1);
    box-shadow: var(--shadow-box);
    z-index: 10;
}

.carousel-slide.next {
    opacity: 0.5;
    transform: translateX(80%) scale(0.85);
    filter: brightness(0.6);
    z-index: 2;
}

.carousel-slide.active .slide-overlay {
    background: rgba(0, 0, 0, 0.1);
}

/* Boutons de navigation */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    background: var(--navbar-bg-rgba);
    border: 2px solid var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(var(--navbar-blur));
    box-shadow: 0 8px 32px var(--bg-gradient-overlay);
}

.carousel-btn:hover {
    border-color: var(--primary-color);
}

.carousel-btn-prev {
    left: 30px;
}

.carousel-btn-next {
    right: 30px;
}

/* Créer les flèches avec CSS au lieu d'images */
.carousel-btn::before {
    content: '';
    width: 14px;
    height: 14px;
    border-top: 3px solid var(--text-color);
    border-right: 3px solid var(--text-color);
    transition: all 0.3s ease;
}

.carousel-btn-prev::before {
    transform: rotate(-135deg); /* Flèche vers la gauche */
    margin-left: 3px;
}

.carousel-btn-next::before {
    transform: rotate(45deg); /* Flèche vers la droite */
    margin-right: 3px;
}

.carousel-btn:hover::before {
    border-color: var(--text-color);
    transform: scale(1.1) rotate(-135deg);
}

.carousel-btn-next:hover::before {
    transform: scale(1.1) rotate(45deg);
}

/* Cacher les images si elles existent encore */
.carousel-btn img {
    display: none;
}



/* Animation de défilement automatique */
@keyframes slideRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .carousel-viewport {
        height: 350px;
    }
    
    .carousel-slide .slide-title {
        font-size: 2.5rem;
        bottom: 30px;
    }
    
    .carousel-btn {
        width: 50px;
        height: 50px;
    }
    
    .carousel-btn img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .services-carousel-section {
        /* Keep vertical centering without extra vertical padding */
        padding: 0 15px;
    }
    
    .carousel-heading {
        font-size: 2rem;
    }
    
    .carousel-viewport {
        height: 280px;
        border-radius: 15px;
    }
    
    .carousel-slide {
        border-radius: 15px;
    }
    
    .carousel-slide .slide-title {
        font-size: 2rem;
        bottom: 20px;
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
    }
    
    .carousel-btn-prev {
        left: 15px;
    }
    
    .carousel-btn-next {
        right: 15px;
    }
}

@media (max-width: 480px) {
    .carousel-heading {
        font-size: 1.8rem;
    }
    
    .carousel-viewport {
        height: 220px;
    }
    
    .carousel-slide .slide-title {
        font-size: 1.5rem;
        bottom: 15px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-btn img {
        width: 16px;
        height: 16px;
    }
}

/* Loading states */
.carousel-slide.loading .slide-image {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-primary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Error state */
.carousel-error {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 20px;
    color: var(--text-color);
    text-align: center;
    padding: 40px;
}

.error-content h3 {
    font-family: 'Title', sans-serif;
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.error-content p {
    font-family: 'Regular', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 10px;
    opacity: 0.8;
}
