/**
 * IDFYX File Upload Styles
 * Styles modernes pour le composant d'upload de fichiers
 */

/* Zone d'upload principale */
.file-upload-area {
    width: 100%;
    margin: 1rem 0;
}

.upload-zone {
    border: 2px dashed #3b82f6;
    border-radius: 12px;
    padding: 2rem;
    background: linear-gradient(135deg, #f8faff 0%, #f1f5f9 100%);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Mode sombre pour la zone d'upload */
.dark .upload-zone {
    border: 2px dashed #3b82f6;
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    color: #f9fafb;
}

.dark .upload-zone:hover {
    border-color: #2563eb;
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.dark .upload-zone.dragover {
    border-color: #10b981;
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.dark .upload-zone.disabled {
    border-color: #6b7280;
    background: #374151;
    opacity: 0.6;
}

.upload-zone:hover {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.upload-zone.dragover {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.upload-zone.disabled {
    border-color: #d1d5db;
    background: #f9fafb;
    cursor: not-allowed;
    opacity: 0.6;
}

.upload-zone.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Icône d'upload */
.upload-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.upload-icon svg {
    width: 3rem;
    height: 3rem;
    color: #3b82f6;
    transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon svg {
    color: #2563eb;
    transform: scale(1.1);
}

.upload-zone.dragover .upload-icon svg {
    color: #10b981;
    transform: scale(1.2);
}

/* Texte d'upload */
.upload-text h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.upload-link {
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.3s ease;
}

.upload-link:hover {
    color: #2563eb;
}

.upload-info {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Mode sombre pour le texte d'upload */
.dark .upload-text h4 {
    color: #f9fafb;
}

.dark .upload-link {
    color: #60a5fa;
}

.dark .upload-link:hover {
    color: #93c5fd;
}

.dark .upload-info {
    color: #d1d5db;
}
    margin: 0;
    line-height: 1.5;
}

/* Liste des fichiers */
.files-list {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.files-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.files-title::before {
    content: "";
    font-size: 1.125rem;
    display: inline-block;
    width: 1.125rem;
    height: 1.125rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z' /%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

.files-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Mode sombre pour la liste des fichiers */
.dark .files-list {
    background: #374151;
    border: 1px solid #4b5563;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .files-title {
    color: #f9fafb;
}

.dark .files-container {
    background: #374151;
}

/* Éléments de fichier individuels */
.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(4px);
}

/* Mode sombre pour les éléments de fichier */
.dark .file-item {
    background: #4b5563;
    border: 1px solid #6b7280;
}

.dark .file-item:hover {
    background: #6b7280;
    border-color: #9ca3af;
}

/* Prévisualisation des fichiers */
.file-preview {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.file-preview i {
    font-size: 1.25rem;
    color: #6b7280;
}

.file-preview .fa-image { color: #10b981; }
.file-preview .fa-file-pdf { color: #ef4444; }
.file-preview .fa-file-word { color: #3b82f6; }
.file-preview .fa-file-text { color: #8b5cf6; }

/* Informations du fichier */
.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

/* Mode sombre pour la prévisualisation et les informations */
.dark .file-preview {
    background: #6b7280;
    border: 1px solid #9ca3af;
}

.dark .file-name {
    color: #f9fafb;
}

.dark .file-details {
    color: #d1d5db;
}

.file-details {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.file-size, .file-type {
    font-size: 0.75rem;
    color: #6b7280;
}

.file-type {
    background: #e5e7eb;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Bouton de suppression */
.remove-file {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #fecaca;
    border-color: #fca5a5;
    transform: scale(1.1);
}

.remove-file svg {
    width: 1rem;
    height: 1rem;
}

/* Résumé d'upload */
.upload-summary {
    margin-top: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

/* Mode sombre pour le résumé d'upload */
.dark .upload-summary {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border: 1px solid #3b82f6;
}

.dark .stat-label {
    color: #d1d5db;
}

.dark .stat-value {
    color: #f9fafb;
}

/* Messages d'erreur */
.upload-error {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    animation: slideInDown 0.3s ease;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: #dc2626;
}

.error-content span {
    flex: 1;
    font-size: 0.875rem;
    color: #991b1b;
    font-weight: 500;
}

.close-error {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-error:hover {
    background: #fee2e2;
}

/* Mode sombre pour les messages d'erreur */
.dark .upload-error {
    background: #7f1d1d;
    border: 1px solid #dc2626;
}

.dark .error-content span {
    color: #fecaca;
}

.dark .close-error:hover {
    background: #991b1b;
}

/* Animations */
@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.file-item {
    animation: fadeInUp 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-zone {
        padding: 1.5rem 1rem;
        min-height: 100px;
    }
    
    .upload-icon svg {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .upload-text h4 {
        font-size: 1rem;
    }
    
    .upload-info {
        font-size: 0.8125rem;
    }
    
    .file-item {
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .file-preview {
        width: 36px;
        height: 36px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* États de chargement */
.upload-zone.uploading {
    pointer-events: none;
    opacity: 0.7;
}

.upload-zone.uploading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Intégration avec le formulaire IDFYX */
.form-section .file-upload-area {
    grid-column: 1 / -1;
}

.modern-form .file-upload-area {
    margin: 1.5rem 0;
}

/* Couleurs de progression */
.text-orange-600 { color: #ea580c; }
.text-green-600 { color: #16a34a; }

/* Style pour FontAwesome si non chargé */
.fas::before {
    font-family: "Font Awesome 5 Free", sans-serif;
    font-weight: 900;
}

.fa-image::before { content: "\f03e"; }
.fa-file-pdf::before { content: "\f1c1"; }
.fa-file-word::before { content: "\f1c2"; }
.fa-file-text::before { content: "\f15c"; }
.fa-file::before { content: "\f15b"; } 