/* Style général */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* Titre principal */
h1 {
    margin: 20px 0;
}

/* Galerie */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.gallery img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.gallery img:hover {
    transform: scale(1.05);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* Caché par défaut */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
    visibility: visible; /* Toujours visible sauf lors de masquage temporaire */
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 1100;
}

.lightbox .prev,
.lightbox .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    z-index: 1100;
}

.lightbox .prev {
    left: 20px;
}

.lightbox .next {
    right: 20px;
}

/* Barre de progression */
.loading-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: 80%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    transform: translateX(-50%);
    display: none; /* Masquée par défaut */
    z-index: 1050; /* Visible sous les flèches */
}

.loading-bar {
    width: 0%;
    height: 100%;
    background-color: #fff;
    transition: width 0.1s linear;
}

/* Responsive */
@media (max-width: 600px) {
    .gallery img {
        width: 100px;
        height: 75px;
    }

    .lightbox .prev,
    .lightbox .next {
        font-size: 30px;
    }

    .loading-container {
        width: 90%; /* Barre plus large sur mobile */
        height: 8px; /* Barre plus fine sur mobile */
        bottom: 10px; /* Barre légèrement plus haute */
    }
}

/* Effets supplémentaires (optionnel) */
.gallery img:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.lightbox img {
    transition: opacity 0.3s ease-in-out;
}
