/* Modales de confirmation */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1e1e1e;
    color: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    min-width: 300px;
    max-width: 500px;
    width: 90%;
    text-align: left;
    border: 1px solid #3a3a3a;
}

.modal h2 {
    margin-bottom: 1.5rem;
}

/* Modale de chargement upload */
.modal-upload {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.spinner {
    border: 4px solid #3a3a3a;
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Zone de dépôt de fichiers */
.upload-zone {
    border: 2px dashed #2196f3;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    margin: 1rem;
    background-color: rgba(33, 150, 243, 0.1);
}

.upload-zone.drag-over {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: #1976d2;
}

#imageUploadForm {
    display: none;
}

/* Grille d'images */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.image-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    overflow: hidden;
}

.image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-share-link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.image-item img,
.image-item .admin-video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
}

.image-item:hover img,
.image-item:hover .admin-video-thumb {
    transform: scale(1.1);
}

.image-item.is-dragging {
    opacity: 0.4;
}

.drag-handle {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 0.5rem;
    cursor: grab;
    font-size: 1rem;
}

.image-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.image-checkbox {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 3;
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #2196f3;
    opacity: 0.8;
}

.image-checkbox:hover {
    transform: scale(1.1);
    opacity: 1;
}
