/* Animations et améliorations visuelles pour l'application AidAnnot */

/* Animation de transition de page - fondu enchaîné */
.page-transition {
    animation: fadeIn 0.4s ease-in-out;
}

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

/* Améliorations visuelles pour les cartes et conteneurs */
.card, .container-shadow {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* Animation des boutons */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animation des onglets de navigation */
.nav-link {
    position: relative;
    transition: all 0.2s ease;
}

.nav-link:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    opacity: 0;
}

.nav-link:hover:before {
    width: 80%;
    opacity: 0.7;
}

.nav-link.active:before {
    width: 90%;
    opacity: 1;
}

/* Animation des notifications et alertes */
.alert {
    animation: slideDown 0.5s ease forwards;
}

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

/* Animation progressive des contenus */
.fade-in-section {
    opacity: 1; /* On commence avec l'opacité à 1 pour éviter le problème de contenu invisible */
    animation: fadeInSection 0.8s ease-out forwards;
}

@keyframes fadeInSection {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Améliorations visuelles pour le mode sombre */
@media (prefers-color-scheme: dark) {
    .card, .container-shadow {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
    
    .card:hover, .container-shadow:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    }
}

/* Animation de pulsation pour les éléments d'attention */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Animation pour le compteur d'annotations */
.counter-number {
    animation: countUp 2s ease-out forwards;
    display: inline-block;
    background: linear-gradient(45deg, #0d6efd, #198754);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(13, 110, 253, 0.3);
}

.counter-label {
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

@keyframes countUp {
    0% { 
        transform: translateY(20px); 
        opacity: 0; 
    }
    100% { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

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

/* Animation de transition entre les pages */
.page-container {
    position: relative;
    min-height: 50vh;
}

/* Effet de fondu pour les transitions entre pages */
.fade-transition-enter {
    opacity: 0;
}

.fade-transition-enter-active {
    opacity: 1;
    transition: opacity 300ms;
}

.fade-transition-exit {
    opacity: 1;
}

.fade-transition-exit-active {
    opacity: 0;
    transition: opacity 300ms;
}

/* Amélioration de l'apparence des tableaux */
table {
    transition: all 0.3s ease;
}

table tr {
    transition: background-color 0.2s ease;
}

table tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Styles des contrôles de formulaires améliorés avec animations */
.form-control, .form-select {
    transition: all 0.3s ease;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
    transform: translateY(-1px);
}

/* Animation du logo */
.logo-animate {
    transition: all 0.5s ease;
}

.logo-animate:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 5px rgba(0, 123, 255, 0.5));
}

/* Styles de secours pour garantir que le contenu est toujours visible */
body {
    opacity: 1 !important;
}

main {
    opacity: 1 !important;
}

/* Fallback pour garantir que le contenu est toujours visible */
.fade-in-section {
    animation-fill-mode: both;
}

/* Solution de secours pour toutes les sections animées */
@media (prefers-reduced-motion: reduce) {
    .fade-in-section, 
    .page-transition, 
    .container, 
    .card, 
    .chat-container {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
}