/* ===== ANIMATIONS ===== */

.labels-suggestions-list {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    animation: fadeIn 0.1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================
   ANIMATIONS AUTO-SCROLL GÉNÉRALES
   ========================================== */

/* Animation générale pour tout élément avec highlight-animate */
.highlight-animate {
    animation: autoScrollHighlight 1.2s ease-out;
}

/* Transition fluide pour les éléments qui peuvent être highlight-animate ou current-email */
.email-item, .task-list-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 1s ease, border-color 1s ease;
}

/* Animation générale de surbrillance après auto-scroll */
@keyframes autoScrollHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.8);
        background: rgba(59, 130, 246, 0.1);
    }
    
    30% {
        transform: scale(1.02);
        box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
        background: rgba(59, 130, 246, 0.15);
    }
    
    60% {
        transform: scale(1.01);
        background: rgba(59, 130, 246, 0.08);
    }
    
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
        background: inherit;
    }
}

/* Animation spécifique pour les tâches sélectionnées */
.task-list-item.selected.highlight-animate {
    animation: taskHighlight 1s ease-out;
}

@keyframes taskHighlight {
    0% {
        background: #dbeafe;
        border-color: #3b82f6;
        transform: translateX(0);
    }
    
    25% {
        background: #bfdbfe;
        border-color: #2563eb;
        transform: translateX(4px);
    }
    
    50% {
        background: #dbeafe;
        transform: translateX(-2px);
    }
    
    75% {
        background: #eff6ff;
        transform: translateX(1px);
    }
    
    100% {
        background: #dbeafe;
        border-color: #3b82f6;
        transform: translateX(0);
    }
}

/* ===== ÉTATS DE FOCUS ET HOVER ===== */

.labels-search-input:focus+.labels-suggestions-list {
    display: block;
}

.suggestion-item:active:not(.disabled):not(.no-results) {
    background-color: #e0f2fe;
    transform: scale(0.98);
}

/* ===== INDICATEURS VISUELS ===== */

.labels-search-container::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    pointer-events: none;
    opacity: 0.5;
}

.labels-search-input:focus~.labels-search-container::after {
    opacity: 0.8;
}

/* ===== ÉTAT ACTIF POUR L'EMAIL COURANT ===== */

.email-item.current-email {
    /* État initial - subtil et élégant */
    background: #eff6ff;
    border: 2px solid #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transform: none;
}

/* Animation minimaliste qui se déclenche uniquement avec highlight-animate */
.email-item.current-email.highlight-animate {
    animation: subtileHighlight 0.8s ease-out;
}

/* Transition fluide lors de la suppression de current-email */
.email-item {
    transition: background-color 1s ease, border-color 1s ease, box-shadow 1s ease, transform 0.3s ease;
}

/* État normal après suppression de current-email */
.email-item:not(.current-email) {
    /* Transition douce vers l'état normal */
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

/* Animation fade-out pour current-email qui va être supprimé */
.email-item.current-email.fade-out {
    animation: fadeOutCurrentEmail 1s ease-out forwards;
}

@keyframes fadeOutCurrentEmail {
    0% {
        background: #eff6ff;
        border-color: #3b82f6;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    }
    100% {
        background: white;
        border-color: #e2e8f0;
        box-shadow: none;
    }
}

/* Animation subtile et fluide pour la surbrillance */
@keyframes subtileHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6);
        background: #eff6ff;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
        background: #dbeafe;
    }
    100% {
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
        background: #eff6ff;
    }
}

.email-item:not(.current-email).classified {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.email-item:not(.current-email).blacklisted {
    border: 2px solid #dc2626;
    background: #fef2f2;
}

.email-item:not(.current-email).blacklisted:hover {
    background: #fee2e2;
    border-color: #b91c1c;
}

/* ===== ANIMATIONS DE TRANSITION EMAIL ===== */

/* Container principal pour les transitions */
.email-content {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations de glissement */
@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideOutToLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Classes d'animation */
.slide-in-right {
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-left {
    animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-out-right {
    animation: slideOutToRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-out-left {
    animation: slideOutToLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}



