/**
 * ========================================
 * STYLES: UPLOAD D'IMAGES
 * ========================================
 */

.image-uploader {
    width: 100%;
}

/* Zone d'upload */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-area.dragover {
    border-color: #2563eb;
    background: #dbeafe;
    transform: scale(1.02);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #9ca3af;
    margin: 0 auto 16px;
    display: block;
}

.upload-text {
    margin-bottom: 16px;
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.upload-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.btn-upload {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upload:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-upload:active {
    transform: translateY(0);
}

/* Prévisualisation */
.upload-preview {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.preview-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.preview-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.preview-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.preview-info {
    margin-bottom: 8px;
}

.preview-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.preview-size {
    font-size: 12px;
    color: #6b7280;
}

.preview-progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.preview-status {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 20px;
}

.preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: white;
}

.preview-item:hover .preview-remove {
    opacity: 1;
}

.preview-remove:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
}

.preview-remove svg {
    width: 16px;
    height: 16px;
}

/* États */
.upload-success {
    border-color: #10b981;
}

.upload-success .preview-image {
    border: 2px solid #10b981;
}

.upload-error {
    border-color: #ef4444;
}

.upload-error .preview-image {
    border: 2px solid #ef4444;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 640px) {
    .upload-area {
        padding: 30px 15px;
    }

    .upload-icon {
        width: 40px;
        height: 40px;
    }

    .upload-title {
        font-size: 14px;
    }

    .upload-subtitle {
        font-size: 12px;
    }

    .upload-preview {
        grid-template-columns: 1fr;
    }
}

/* Animation de chargement */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.preview-item.uploading .preview-image {
    animation: shimmer 2s infinite;
    background: linear-gradient(
        90deg,
        #f3f4f6 0px,
        #e5e7eb 40px,
        #f3f4f6 80px
    );
    background-size: 1000px 100%;
}
