/**
 * Rougier et Fils - Module d'Autocomplétion Intelligente
 * Base Adresse Nationale (BAN) & Base Sirene Entreprises (INSEE)
 * Version 1.0 - 2026
 */

/* Conteneur principal flottant de l'autocomplétion */
.rougier-ac-dropdown {
    position: absolute;
    z-index: 100050 !important;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.35rem 0;
    font-family: inherit;
    animation: rougierAcFadeIn 0.15s ease-out;
    box-sizing: border-box;
}

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

/* En-tête / Source de données */
.rougier-ac-header {
    padding: 0.4rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rougier-ac-header .badge-source {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Ligne de suggestion */
.rougier-ac-item {
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background-color 0.12s ease, transform 0.08s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.rougier-ac-item:last-child {
    border-bottom: none;
}

.rougier-ac-item:hover,
.rougier-ac-item.rougier-ac-active {
    background-color: #f0f7ff !important;
}

.rougier-ac-type-sirene .rougier-ac-item:hover,
.rougier-ac-type-sirene .rougier-ac-item.rougier-ac-active {
    background-color: #eff6ff !important;
}

/* Icônes d'illustration */
.rougier-ac-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    margin-top: 2px;
}

.rougier-ac-icon-adresse {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.rougier-ac-icon-sirene {
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
}

/* Corps textuel */
.rougier-ac-content {
    flex-grow: 1;
    min-width: 0;
}

.rougier-ac-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.rougier-ac-title strong {
    color: #0f172a;
}

.rougier-ac-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.35;
}

.rougier-ac-details {
    font-size: 0.73rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

/* Badges d'information */
.rougier-ac-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    white-space: nowrap;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.rougier-ac-badge-siren {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.rougier-ac-badge-postcode {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

/* Pied de liste */
.rougier-ac-footer {
    padding: 0.35rem 0.85rem;
    font-size: 0.68rem;
    color: #94a3b8;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
    text-align: right;
}

/* États de chargement et vide */
.rougier-ac-loading,
.rougier-ac-empty {
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    color: #64748b;
    text-align: center;
}

.rougier-ac-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    margin-right: 0.4rem;
}

/* Animation de confirmation lors du préremplissage */
.rougier-ac-filled {
    animation: rougierAcFlash 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rougierAcFlash {
    0% {
        background-color: rgba(34, 197, 94, 0.25);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}
