/* Styles généraux */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.success {
    color: green;
    margin-bottom: 10px;
    text-align: center;
}

.errors {
    color: red;
    margin-bottom: 10px;
    text-align: center;
}

/* Liste des dossiers */
.folder-list {
    margin: 20px 0;
}

.folders {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.folder-link {
    text-decoration: none;
    color: inherit;
}

.folder {
    background: #f0f0f0;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.folder:hover {
    background: #e0e0e0;
}

.folder.active {
    background: #007bff;
    color: white;
}

/* Galerie */
.gallery-container {
    margin-top: 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.gallery-item {
    position: relative;
    border: 1px solid #ddd;
    padding: 5px;
    background: white;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.gallery-item-info {
    padding: 5px;
    font-size: 12px;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
}

.image-name {
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-date {
    color: #666;
    font-size: 11px;
    margin: 0;
}

.gallery-item-actions {
    margin-top: 5px;
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a {
    padding: 5px 10px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.pagination a.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a:hover:not(.active) {
    background: #f0f0f0;
}

/* Bouton de suppression */
.delete-selected {
    padding: 8px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    display: block;
    width: fit-content;
}

.delete-selected:hover {
    background: #c82333;
}

/* Modale pour l'image agrandie */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    margin-top: 30px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

#modalCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
}

/* Modale de confirmation de suppression */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.confirm-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 500px;
    text-align: center;
}

.confirm-modal-content h3 {
    margin-top: 0;
    color: #333;
}

.confirm-modal-content p {
    margin: 15px 0;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.confirm-buttons .button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.confirm-buttons .cancel {
    background-color: #ccc;
    color: #333;
}

.confirm-buttons .delete {
    background-color: #dc3545;
    color: white;
}

.confirm-buttons .button:hover {
    opacity: 0.9;
}

/* Options de tri */
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.sort-options span {
    font-weight: bold;
}

.sort-link {
    padding: 5px 10px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}

.sort-link:hover {
    background-color: #f0f0f0;
}

.sort-link.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}
