/**
 * Custom File Upload Styles
 * Styles pour le champ de téléchargement de fichiers personnalisé
 */

.custom-file-upload-field-shortcode {
    margin: 15px 0;
    font-family: 'Avenir LT Pro', sans-serif;
}

.custom-file-upload-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #0c3042;
    font-family: 'Avenir LT Pro', sans-serif;
}

.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-display {
    border: 2px dashed #ddd !important;
    padding: 20px;
    text-align: left;
    background: #f9f9f9 !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-display:hover {
    border-color: #007cba !important;
    background: #f0f8ff !important;
}

.file-upload-display.dragover {
    border-color: #007cba !important;
    background: #e6f3ff !important;
}

.upload-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.upload-icon {
    font-size: 24px;
    color: #666;
    margin-right: 12px;
    flex-shrink: 0;
}

.upload-text {
    color: #666!important;
    font-size: 14px;
    font-family: 'Avenir LT Pro', sans-serif;
    flex: 1;
}

.files-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #e8f5e8;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid #4caf50;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #2d5a2d;
    font-family: 'Avenir LT Pro', sans-serif;
    display: block;
    margin-bottom: 2px;
}

.file-size {
    color: #666;
    font-size: 12px;
    font-family: 'Avenir LT Pro', sans-serif;
}

.remove-file {
    background: #ff4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.remove-file:hover {
    background: #cc0000;
}

.remove-file:active {
    background: #aa0000;
}

.file-error {
    display: none;
    color: #ff4444;
    font-size: 12px;
    margin-top: 5px;
    font-family: 'Avenir LT Pro', sans-serif;
}

.files-count {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    font-family: 'Avenir LT Pro', sans-serif;
    text-align: left;
}

/* Responsive */
@media (max-width: 768px) {
    .file-upload-display {
        padding: 10px 12px;
        min-height: 44px;
    }
    
    .upload-icon {
        font-size: 18px;
        margin-right: 10px;
    }
    
    .upload-text {
        font-size: 13px;
    }
    
    .file-info {
        padding: 6px 10px;
    }
    
    .file-name {
        font-size: 14px;
    }
    
    .file-size {
        font-size: 11px;
    }
}

/* Animation pour le drag and drop */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.file-upload-display.dragover {
    animation: pulse 0.5s ease-in-out;
}

/* Styles pour les états de validation */
.file-upload-display.valid {
    border-color: #4caf50;
    background: #f1f8e9;
}

.file-upload-display.invalid {
    border-color: #ff4444;
    background: #ffebee;
}

/* Styles pour l'accessibilité */
.file-input:focus + .file-upload-display {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Forcer le style du fond pour éviter les conflits */
.custom-file-upload-field-shortcode .file-upload-display {
    background: #f9f9f9 !important;
    border: 2px dashed #ddd !important;
}

.custom-file-upload-field-shortcode .file-upload-display:hover {
    background: #f0f8ff !important;
    border-color: #007cba !important;
}

.custom-file-upload-field-shortcode .file-upload-display.dragover {
    background: #e6f3ff !important;
    border-color: #007cba !important;
}

/* Styles pour les thèmes sombres */
@media (prefers-color-scheme: dark) {
    .custom-file-upload-label {
        color: #0C3042!important;
    }
    
    .file-upload-display {
        background: #2a2a2a;
        border-color: #555;
    }
    
    .file-upload-display:hover {
        background: #3a3a3a;
        border-color: #007cba;
    }
    
    .upload-text {
        color: #ccc;
    }
    
    .upload-icon {
        color: #999;
    }
}
