@keyframes popupFadeIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes popupFadeOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* Popup plein écran */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Cacher le popup */
.popup.hidden {
    display: none;
}

/* Contenu du popup */
.popup-content {
    background: lightgray;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.8);
}

/* Animation ouverture */
.popup-content.animate-in {
    animation: popupFadeIn 0.3s ease forwards;
}

/* Animation fermeture */
.popup-content.animate-out {
    animation: popupFadeOut 0.3s ease forwards;
}



/* Bouton de fermeture (croix) */
.popup .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: transform 0.2s ease, color 0.2s ease;
}

.popup .close:hover {
    transform: scale(1.3);
    color: #c62828;
}

/* Grille d'images */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Image avec bouton superposé */
.image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.image-wrapper img {
    width: 50%;
    height: auto;
    display: block;
    border-radius: 10px;
}

/* Bouton download */
.download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #c62828;
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.download-btn i {
    font-size: 16px;
}

.image-wrapper:hover .download-btn {
    opacity: 1;
}

.download-btn:hover {
    background-color: black;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}


#openGallery {
    background-color: #ef5350;
    color: white;
    border-radius: 7px;
    height: 7em;

}

.folder-container {
    display: flex;
    gap: 20px; /* espace entre les boutons */
    justify-content: center; /* centre horizontalement */
    flex-wrap: nowrap; /* empêche les boutons de passer à la ligne */
}

.folders-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap; /* pour responsive */
}

/* Garde le style existant du dossier */
.folder-preview {
    width: 130px;
    text-align: center;
    cursor: pointer;
}

.folder-icon {
    position: relative;
    font-size: 60px;
    color: #f5c542;
}

.folder-thumbnail {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.folder-name {
    margin-top: 10px;
    font-weight: bold;
    color: #c62828;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .folder-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .folder-preview {
        width: 45%; /* deux par ligne */
        margin-bottom: 20px;
    }

    .folder-icon {
        font-size: 50px;
    }

    .folder-thumbnail {
        width: 50px;
        height: 50px;
    }

    .popup-content {
        width: 95%;
        padding: 1rem;
    }
}


@media screen and (max-width: 480px) {
    .folder-preview {
        width: 90%;
    }

    .folder-thumbnail {
        width: 40px;
        height: 40px;
    }

    .folder-name {
        font-size: 1rem;
    }
}

