/**
 * Styles pour les Carousels de Projets Souknati
 */

/* Variables CSS pour la configuration */
:root {
    --carousel-item-width-mobile: 150px;
    --carousel-item-width-tablet: 170px;
    --carousel-item-width-desktop: 220px;
    
    --carousel-items-visible-mobile: 2;
    --carousel-items-visible-tablet: 4;
    --carousel-items-visible-desktop: 6;
    
    --carousel-transition-duration: 0.7s;
    --carousel-item-spacing: 16px;
}

/* Container principal du carousel */
.projets-carousel {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/* Track du carousel */
.projets-carousel .carousel-track {
    display: flex;
    transition: transform var(--carousel-transition-duration) ease-in-out;
    gap: var(--carousel-item-spacing);
}

.projets-carousel::before,
.projets-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    pointer-events: none; /* important : ne bloque pas les clics sur le carrousel */
    z-index: 2;    
}

/* Mobile */
@media (max-width: 767px) {
    .projets-carousel::before,
    .projets-carousel::after {
        width: 1rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1365px) {
    .projets-carousel::before,
    .projets-carousel::after {
        width: 1.5rem;
    }
}

/* Desktop */
@media (min-width: 1366px) {
    .projets-carousel::before,
    .projets-carousel::after {
        width: 2.5rem;
    }
}

.projets-carousel::before {
    left: 0;
    /*background: linear-gradient(to right, var(--color-gray-50), transparent);*/
}

.projets-carousel::after {
    right: 0;
    /*background: linear-gradient(to left, var(--color-gray-50), transparent);*/
}

/* Items du carousel */
.projets-carousel .carousel-item {
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Responsive - Mobile: 3 projets visibles */
@media (max-width: 767px) {
    .projets-carousel .carousel-item {
        width: var(--carousel-item-width-mobile);
        min-width: var(--carousel-item-width-mobile);
    }
    
    .projets-carousel {
        padding: 0 1rem;
    }
    
    .projets-carousel .carousel-track {
        padding-left: 0;
    }
}

/* Responsive - Tablet: 4 projets visibles */
@media (min-width: 768px) and (max-width: 1365px) {
    .projets-carousel .carousel-item {
        width: var(--carousel-item-width-tablet);
        min-width: var(--carousel-item-width-tablet);
    }
    
    .projets-carousel {
        padding: 0 2rem;
    }
    
    .projets-carousel .carousel-track {
        padding-left: 0;
    }
}

/* Responsive - Desktop: 6 projets visibles */
@media (min-width: 1366px) {
    .projets-carousel .carousel-item {
        width: var(--carousel-item-width-desktop);
        min-width: var(--carousel-item-width-desktop);
    }
    
    .projets-carousel {
        padding: 0 3rem;
    }
    
    .projets-carousel .carousel-track {
        padding-left: 0;
    }
}

/* Boutons de navigation */
.carousel-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    column-gap: 0.5rem;
}
.projets-carousel .carousel-prev,
.projets-carousel .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: white;
    border-radius: 50%;
    padding: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.projets-carousel .carousel-prev {
    left: 0;
}

.projets-carousel .carousel-next {
    right: 0;
}

.projets-carousel .carousel-prev:hover,
.projets-carousel .carousel-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

/* Masquer les flèches sur mobile et tablette */
.projets-carousel .carousel-prev,
.projets-carousel .carousel-next {
    display: none;
}

@media (min-width: 1366px) {
    .projets-carousel .carousel-prev,
    .projets-carousel .carousel-next {
        display: block;
        padding: 0.2rem;
        position: relative;
    }
}

@media (max-width: 1365px) {
    .carousel-buttons {
        display: none;
    }
}

/* Indicateurs */
.projets-carousel .carousel-indicators {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    padding-bottom: 0.05rem;
}

.projets-carousel .carousel-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #d1d5db;
    transition: all 0.3s ease;
    cursor: pointer;
}

.projets-carousel .carousel-indicator:hover {
    transform: scale(1.2);
    background-color: #9ca3af;
}

.projets-carousel .carousel-indicator.active {
    background-color: #626772;
    transform: scale(1.1);
}

/* Améliorations pour le tactile */
.projets-carousel {
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

.projets-carousel .carousel-item {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Curseur de glissement sur desktop */
.projets-carousel {
    cursor: grab;
}

.projets-carousel:active {
    cursor: grabbing;
}

/* Animation d'entrée pour les nouveaux projets visibles */
.projets-carousel .carousel-item.entering {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Styles pour les cartes de projets */
.projets-carousel .projet-card {
    background: transparent;
    border-radius: 0.5rem;
    /*box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);*/
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateY(0);
}

/*.projets-carousel .projet-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}*/

/* Responsive des cartes */
@media (max-width: 767px) {
    .projets-carousel .projet-card {
        height: 16.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1365px) {
    .projets-carousel .projet-card {
        height: 16.5rem;
    }
}

@media (min-width: 1366px) {
    .projets-carousel .projet-card {
        height: 16.5rem;
    }
}
