/* 
 * 🎨 STYLES POUR SYNCHRONISATION STATISTIQUES
 * CSS pour les améliorations de la synchronisation des statistiques lors des changements de dossier
 */
/* Animation de rotation pour les spinners */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles pour les éléments de statistiques */
.stat-value {
    transition: all 0.3s ease-in-out;
    display: inline-block;
}

.stat-value.updating {
    color: #2196F3 !important;
    animation: pulse-update 1.5s infinite;
}



/* Styles pour les spinners de chargement */
.fa-spinner.fa-spin {
    color: #D88449;
    animation: spin 1s linear infinite;
}

/* Toast de notification pour les changements de dossier */
.folder-change-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #D88449, #C77541);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease-in-out;
}

.folder-change-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.folder-change-toast .icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Indicateur de statut de dossier */
.folder-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.folder-status-indicator.syncing {
    background: #D88449;
    animation: pulse-dot 1.5s infinite;
}

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

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

@keyframes pulse-dot {
    0% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.2); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* Styles pour les éléments de dossier */
.current-folder-name {
    transition: color 0.3s ease;
    font-weight: 500;
}

.current-folder-name.updating {
    color: #DC714A;
    animation: text-pulse 1.5s infinite;
}

@keyframes text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Badge de notification de changement */
.stats-change-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #DC714A;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.stats-change-badge.show {
    opacity: 1;
    transform: scale(1);
}

/* Effet de hover amélioré pour les stats */
.stats-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .folder-change-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
        font-size: 13px;
        padding: 10px 15px;
    }
    
    .folder-change-toast.show {
        transform: translateY(0);
    }
    
    .stats-box {
        margin-bottom: 10px;
    }
    
    .stat-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .stats-box {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .folder-change-toast {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .stats-box.syncing {
        background: rgba(216, 132, 73, 0.15);
        border-left-color: #DC714A;
    }
    
    .stats-box.success {
        background: rgba(76, 175, 80, 0.15);
        border-left-color: #DC714A;
    }
    
    .stats-box.error {
        background: rgba(244, 67, 54, 0.15);
        border-left-color: #EF5350;
    }
    
    .folder-change-toast {
        background: linear-gradient(135deg, #DC714A, #D88449);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .current-folder-name.updating {
        color: #DC714A;
    }
}

/* État de mise à jour (spinner) */
.stat-value.updating {
    color: #DC714A !important;
}

.stat-value.updating .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Couleurs selon le backend */
#backendName {
    font-weight: 600;
    transition: all 0.3s ease;
}

#backendName.backend-model2vec {
    color: #2196F3;
}

#backendName.backend-qdrant {
    color: #2196F3;
}

/* Animation de la stats-box lors des mises à jour */
.stats-box {
    transition: box-shadow 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-item {
        font-size: 12px;
        padding: 6px 0;
    }
}