/* --- CONFIGURATION GLOBALE --- */
:root {
    --chat-primary: #1a1a1a;
    /* Noir luxe (ou mettez votre couleur de marque) */
    --chat-accent: #333333;
    /* Gris foncé */
    --chat-bg: #ffffff;
    /* Fond blanc pur */
    --chat-bubble-user: #1a1a1a;
    /* Bulle utilisateur sombre */
    --chat-text-user: #ffffff;
    /* Texte utilisateur blanc */
    --chat-bubble-ai: #f4f6f8;
    /* Gris très pâle pour l'IA */
    --chat-text-ai: #2d3748;
    /* Texte IA lisible */
    --chat-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --chat-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- LE CONTENEUR FLOTTANT --- */
#gemini-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    font-family: var(--chat-font);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* --- LE BOUTON D'OUVERTURE (LAUNCHER) --- */
#gemini-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gemini-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* --- LA FENÊTRE DE CHAT --- */
#gemini-chat-window {
    width: 380px;
    /* Plus large pour le confort */
    height: 550px;
    /* Plus haut */
    max-height: 80vh;
    background: var(--chat-bg);
    border-radius: 16px;
    /* Coins arrondis modernes */
    margin-bottom: 20px;
    display: none;
    /* Caché par défaut */
    flex-direction: column;
    box-shadow: var(--chat-shadow);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HEADER --- */
#gemini-chat-header {
    padding: 20px;
    background: var(--chat-bg);
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 16px;
    color: var(--chat-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-chat {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 25px;
    color: #999;
    transition: color 0.2s;
    border-radius: 50px;
}

.close-chat:hover {
    color: var(--chat-primary);
    color: white;
}

/* --- ZONE DES MESSAGES --- */
#gemini-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fff;
    scroll-behavior: smooth;
}

/* Scrollbar invisible mais fonctionnelle */
#gemini-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#gemini-chat-messages::-webkit-scrollbar-thumb {
    background-color: #e0e0e0;
    border-radius: 3px;
}

/* BULLES DE CHAT */
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.user-msg {
    background-color: var(--chat-bubble-user);
    color: var(--chat-text-user);
    border-radius: 18px 18px 2px 18px;
    /* Forme organique */
    margin-left: auto;
    /* Aligné à droite */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ai-msg {
    background-color: var(--chat-bubble-ai);
    color: var(--chat-text-ai);
    border-radius: 18px 18px 18px 2px;
    margin-right: auto;
    /* Aligné à gauche */
}

/* Animation des messages */
.chat-message {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicateur de chargement (3 points) */
.loading-dots {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #bbb;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* --- ZONE DE SAISIE (INPUT) --- */
#gemini-chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    align-items: center;
}

#gemini-chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f9f9f9;
}

#gemini-chat-input:focus {
    background: #fff;
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

#gemini-chat-send {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#gemini-chat-send:hover {
    transform: scale(1.1);
}

#gemini-chat-send svg {
    width: 18px;
    height: 18px;
    fill: white;
    margin-left: 2px;
}

.chat-btn{
    padding: 10px 20px;
    text-align: center;
    color: white;
    background-color: black;
}

/* Ajustement icône avion */

/* MOBILE */
@media (max-width: 480px) {
    #gemini-chat-window {
        width: 100%;
        height: 100%;
        position: fixed;
        bottom: 0;
        right: 0;
        border-radius: 0;
        margin-bottom: 0;
        z-index: 100000;
    }

    #gemini-chat-toggle {
        bottom: 20px;
        right: 20px;
    }
}