/* --- CONTENEUR PRINCIPAL --- */
/* C'est lui qui définit le côté (gauche ou droite) */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px; /* Par défaut à droite */
    z-index: 1050;
}
/* Spécifique pour l'arabe, on le passe à gauche */
body.lang-ar #chatbot-container {
    right: auto;
    left: 20px;
}

/* --- BULLE D'ACTIVATION --- */
#chatbot-bubble {
    position: relative;
    width: 70px;
    height: 70px;
    background-color: var(--chatbot-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    z-index: 1051;
}
#chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}
#chatbot-bubble.hidden {
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
}
#chatbot-bubble img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 5px;
}
.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    background-color: var(--chatbot-secondary);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--chatbot-primary);
}

/* --- FENÊTRE DE CHAT --- */
#chatbot-window {
    position: absolute; /* Est positionnée RELATIVEMENT au conteneur */
    bottom: 90px;
    right: 0; /* Alignée à droite du conteneur */
    width: 400px;
    max-width: 90vw;
    height: 60vh;
    min-height: 400px;
    max-height: 550px;
    background-color: var(--chatbot-bg);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.5) translateY(100px);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right; /* Point d'animation correct */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1052;
}
/* Spécifique pour l'arabe */
body.lang-ar #chatbot-window {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}
#chatbot-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ... (Les styles du header et du footer du chatbot peuvent rester les mêmes) ... */
/* ... (Les styles pour bot-info, bot-status, etc. sont OK) ... */

/* --- CORPS DES MESSAGES (AMÉLIORÉ) --- */
#chatbot-body {
    flex-grow: 1;
    padding: 1rem 0.5rem 1rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
body.lang-ar #chatbot-body { padding: 1rem 1.5rem 1rem 0.5rem; }

/* Amélioration de la scrollbar */
#chatbot-body::-webkit-scrollbar { width: 8px; }
#chatbot-body::-webkit-scrollbar-track { background: #e0e0e0; }
#chatbot-body::-webkit-scrollbar-thumb { background-color: #c0c0c0; border-radius: 10px; }
#chatbot-body::-webkit-scrollbar-thumb:hover { background-color: #a0a0a0; }

.chat-message { max-width: 85%; }
.message-content { font-size: 0.95rem; } /* Léger ajustement */
/* ... (Les styles pour user-message et bot-message sont OK) ... */

/* --- SUGGESTIONS DE QUESTIONS (NOUVEAU) --- */
#chatbot-suggestions {
    margin-top: auto; /* Pousse les suggestions en bas du conteneur de chat */
    padding: 10px 15px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: opacity 0.3s ease;
}
body.lang-ar #chatbot-suggestions { padding: 10px 0 0 15px; }

.suggestion-chip {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.85rem;
    color: var(--bs-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.suggestion-chip:hover {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}
/* Fichier : ipaf/assets/css/chatbot.css */
#chatbot-container { position: fixed; bottom: 20px; left: 20px; z-index: 1000; }
body.lang-ar #chatbot-container { left: auto; right: 20px; }

/* ... [Copiez ici l'intégralité du code CSS du chatbot d'African Metrics] ... */
/* Nous allons simplement l'adapter ci-dessous */

/* --- Adaptations Spécifiques pour IPAF --- */
#chatbot-bubble {
    width: 70px; height: 70px; background-color: var(--bs-primary);
    /* ... autres styles ... */
}
#chatbot-bubble img { width: 100%; height: 100%; border-radius: 50%; padding: 5px; }

/* Fenêtre de Chat plus large */
#chatbot-window {
    width: 400px; /* Plus large */
    height: 550px;
    bottom: 100px; left: 20px;
    transform-origin: bottom left;
}
/*body.lang-ar #chatbot-window { left: auto; right: 20px; transform-origin: bottom right; }*/

/* En-tête */
#chatbot-header { padding: 1rem 1.5rem; }
#chatbot-header .bot-info { display: flex; align-items: center; }
#chatbot-header .bot-info img { width: 45px; height: 45px; border-radius: 50%; margin-right: 15px; }
body.lang-ar #chatbot-header .bot-info img { margin-right: 0; margin-left: 15px; }
#chatbot-header h5 { line-height: 1; }
#chatbot-header .bot-status::before { background-color: var(--bs-secondary); animation: pulse-orange 2s infinite; }

/* Corps des messages */
#chatbot-body { padding: 1.5rem; }
.message-content { font-size: 1rem; } /* Texte plus grand */
.user-message .message-content { background-color: var(--bs-secondary); }

/* Input */
#chatbot-input { padding: 1rem 1.5rem; border-radius: 30px; }
#chatbot-send-btn { width: 50px; height: 50px; }

/* ... (début du fichier) ... */
#chatbot-container { 
    position: fixed; 
    bottom: 20px; 
    left: 20px; 
    z-index: 1050; /* Doit être élevé, 1050 est un bon début (au-dessus de la plupart des éléments Bootstrap) */
}
/* ... */
#chatbot-bubble {
    /* ... */
    z-index: 1051; /* La bulle doit être au-dessus du conteneur */
    transition: transform 0.3s ease, opacity 0.3s ease; /* Ajout de la transition sur l'opacité */
}
#chatbot-bubble.hidden {
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none; /* Empêche de cliquer sur la bulle cachée */
}

#chatbot-window {
    /* ... */
    z-index: 1052; /* La fenêtre doit être au-dessus de la bulle */
}
/* ... (le reste du fichier) ... */


