/* GalleryUploader.css */

.gallery-uploader {
    margin: 20px 0;
}

.gallery-uploader legend {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

/* Barre de progression */
.upload-progress {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.progress-bar {
    height: 30px;
    background: linear-gradient(90deg, #4a90e2, #5d87cb);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    transition: width 0.3s ease;
}

.progress-message {
    margin: 8px 0 0 0;
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* Grille de médias */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
}

.media-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    border: 2px solid #ddd;
    transition: border-color 0.2s;
}

.media-wrapper:hover {
    border-color: #4a90e2;
}

/* Prévisualisation des médias */
.media-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Icône vidéo */
.video-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    padding: 5px;
    font-size: 24px;
}

/* Overlay pendant l'upload */
.uploading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.uploading-overlay svg {
    font-size: 32px;
    color: #4a90e2;
    animation: pulse 1.5s ease-in-out infinite;
}

.uploading-overlay span {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Bouton de suppression */
.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.remove-btn svg {
    font-size: 18px;
}

/* Placeholder pour l'upload */
.upload-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.upload-placeholder:hover .upload-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.plus-icon {
    font-size: 48px;
    color: white;
    font-weight: 300;
    line-height: 1;
}

/* Input file caché */
.file-input {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .gallery-uploader legend {
        font-size: 16px;
    }

    .video-icon {
        font-size: 20px;
        padding: 4px;
    }

    .remove-btn {
        width: 28px;
        height: 28px;
    }

    .plus-icon {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
