:root {
    --color-green: #48e049;
    --thumbnail-height: 250px;
    --modal-image-height: 70vh;
    --border-radius: 12px;
}


/***********GALERIE****************/

.gallery-container {
    padding: 2rem 0;
}

.gallery-item {
    margin-bottom: 1.5rem;
}

.gallery-thumbnail {
    width: 100%;
    height: var(--thumbnail-height);
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid transparent;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(72, 224, 73, 0.3);
    border-color: var(--color-green);
}

.gallery-thumbnail.lazy {
    background-color: #e9ecef;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'%3E%3Cpath d='M25 5A20 20 0 1 0 45 25A20 20 0 0 0 25 5Z' fill='%23dee2e6'/%3E%3Cpath d='M25 10A15 15 0 1 0 40 25A15 15 0 0 0 25 10Z' fill='%23adb5bd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* Animation pour les nouvelles images qui apparaissent */
.gallery-new-item {
    transform: scale(0);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.gallery-zoom-in {
    transform: scale(1);
    opacity: 1;
}

/* Animation de chargement améliorée */
.loading-placeholder {
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    opacity: 0.7;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal personnalisé */
.modal-content {
    background: rgba(0, 0, 0, 0.95) !important;
    border: none;
    box-shadow: none;
}

.carousel-image {
    max-height: var(--modal-image-height);
    max-width: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin: 0 auto;
    display: block;
    box-shadow: 0 0 30px rgba(72, 224, 73, 0.6);
    transition: opacity 0.3s ease;
}

.carousel-image.loading {
    opacity: 0.7;
}

/* Contrôles carousel - masqués par défaut + curseur */
.carousel-control-prev,
.carousel-control-next {
    width: 60px;
    height: 60px;
    background-color: var(--color-green);
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.carousel-control-prev {
    left: 20px;
}

.carousel-control-next {
    right: 20px;
}

/* État actif (souris en mouvement) */
#lightboxCarousel.mouse-active .carousel-control-prev,
#lightboxCarousel.mouse-active .carousel-control-next {
    opacity: 0.8;
    visibility: visible;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.1);
}

/* Masquer le curseur quand inactif */
#lightboxCarousel.mouse-inactive {
    cursor: none;
}

#lightboxCarousel.mouse-inactive * {
    cursor: none !important;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 25px;
    height: 25px;
    background-image: none;
}

.carousel-control-prev-icon::before,
.carousel-control-next-icon::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.carousel-control-prev-icon::before {
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 12px solid white;
    margin-left: -2px;
}

.carousel-control-next-icon::before {
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid white;
    margin-left: 2px;
}

/* Indicateurs personnalisés */
.carousel-indicators {
    bottom: -50px;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-green);
    border: 2px solid white;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.carousel-indicators .active {
    opacity: 1;
}

/* Compteur d'images */
.image-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(72, 224, 73, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

/* Responsive - masquer les contrôles sur mobile */
@media (max-width: 991.98px) {
    .carousel-controls {
        display: none !important;
    }
    
    .gallery-thumbnail {
        height: 200px;
    }
    
    .carousel-image {
        max-height: 60vh;
    }
}

@media (max-width: 575.98px) {
    .gallery-thumbnail {
        height: 180px;
    }
    
    .carousel-image {
        max-height: 50vh;
    }
}

/* Animation de chargement */
.loading-placeholder {
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}