/* document-folders-ui.css - Styles pour l'interface de gestion des dossiers */

.folders-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.folders-modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideInFromTop 0.4s ease;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.folder-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.folder-item.active {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
    border-color: #4CAF50 !important;
}

.folder-section {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.current {
    background: #4CAF50;
    color: white;
}

.badge.inactive {
    background: #e0e0e0;
    color: #666;
}

.create-folder-form {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    animation: expandIn 0.4s ease;
}

@keyframes expandIn {
    from {
        max-height: 0;
        opacity: 0;
        padding: 0 20px;
    }
    to {
        max-height: 300px;
        opacity: 1;
        padding: 20px;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.folder-selector-container {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.folder-selector-container h4 {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}

.folder-selector-container select {
    margin-bottom: 10px;
}

.folder-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.folder-actions .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.current-folder-indicator {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.current-folder-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.folder-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.folder-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.folder-stat i {
    width: 16px;
    text-align: center;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading-indicator i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #666;
}

.error-message {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 10px 0;
    color: #c62828;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 10px 0;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-message {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 10px 0;
    color: #1565c0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .folders-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .folders-grid {
        grid-template-columns: 1fr;
    }
    
    .folder-actions {
        flex-direction: column;
    }
    
    .folder-actions .btn {
        min-width: auto;
    }
    
    .folder-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Animation pour les transitions de dossier */
.folder-transition {
    animation: folderSwitch 0.6s ease;
}

@keyframes folderSwitch {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* Styles pour les boutons d'action sur les dossiers */
.folder-item .actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.folder-item:hover .actions {
    opacity: 1;
}

/* Indicateur de statut du dossier */
.folder-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.folder-status.active {
    background: #4CAF50;
}

.folder-status.inactive {
    background: #e0e0e0;
}

.folder-status.error {
    background: #f44336;
}

.quick-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start; /* ou center, flex-end */
    margin-bottom: 20px;
}

/* Spinner de chargement modal */
.modal-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Au-dessus de la modal (10000) */
    animation: fadeIn 0.2s ease;
}

.modal-loading-spinner {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: slideInFromTop 0.3s ease;
}

.modal-loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.modal-loading-spinner .loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}