/* ===== VARIABLES COULEUR (BANQUE) ===== */
:root {
    --clarisse-blue: #0A4DA2;
}

/* ===== CONTENEUR PRINCIPAL ===== */
#ai-chat-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 340px;
    max-width: 90%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-family: Arial, sans-serif;
    z-index: 9999;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* MODE RÉDUIT = MASCOTTE */
#ai-chat-box.minimized {
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
}

/* ===== HEADER ===== */
#ai-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--clarisse-blue);
    color: #ffffff;
    padding: 12px 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 16px;
    max-height: 70px;
    overflow: hidden;
}

/* ❌ SUPPRESSION ICÔNE PAR DÉFAUT */
#ai-chat-header::before {
    display: none !important;
    content: none !important;
}

/* ===== AVATAR CLARISSE ===== */
#clarisse-avatar,
#ai-chat-header img {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    border-radius: 60% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    border: 2px solid #ffffff;
    background: #ffffff;
}

/* NOM CLARISSE */
#ai-chat-header span {
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
}

/* ===== ZONE MESSAGES ===== */
#ai-chat-messages {
    padding: 15px;
    max-height: 320px;
    overflow-y: auto;
    background: #fafafa;

    /* 🔒 CORRECTION SCROLL (CRITIQUE) */
    overflow-anchor: none;
}

/* LIENS */
#ai-chat-messages a {
    color: var(--clarisse-blue);
    font-weight: 600;
    text-decoration: none;
}

/* ===== ZONE SAISIE ===== */
#ai-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #ffffff;
}

#ai-chat-input input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
    outline: none;
}

/* BOUTON ENVOI */
#ai-chat-input button {
    background: var(--clarisse-blue);
    color: #ffffff;
    border: none;
    border-radius: 60%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 18px;
}

/* MASQUER CONTENU QUAND MINIMISÉ */
#ai-chat-box.minimized #ai-chat-messages,
#ai-chat-box.minimized #ai-chat-input {
    display: none;
}

/* ===== MESSAGES ===== */

/* Message Clarisse */
.clarisse-message {
    padding: 8px 10px;
    margin: 6px 0;
    background: #f6f8fa;
    border-radius: 6px;

    /* 🎯 Ancrage propre pour scrollIntoView */
    scroll-margin-top: 12px;
}

/* Message utilisateur */
.user-message {
    padding: 6px 8px;
    margin: 6px 0;
}

/* Loader */
.clarisse-loader {
    font-size: 0.9em;
    color: #666;
    margin: 4px 0;
}
