/* Sécurité antibug de débordement */
#chatbot-container, 
#chatbot-container *, 
#chatbot-toggle-btn {
    box-sizing: border-box !important;
}

/* Bouton d'ouverture (En bas à gauche) */
#chatbot-toggle-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: #ffa500;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
    font-family: sans-serif;
}

#chatbot-toggle-btn:hover {
    transform: scale(1.05);
}

/* Fenêtre principale du chat */
#chatbot-container {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 800px;
    max-width: calc(100% - 40px); /* Évite de dépasser sur écran mobile */
    z-index: 1000;
    border: 1px solid #ddd;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    font-family: sans-serif;
}

/* En-tête */
.chat-header {
    background: #ffa500;
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

/* Zone d'affichage des messages */
#chat-logs {
    height: 260px;
    overflow-y: auto;
    padding: 15px;
    font-size: 14px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.chat-msg {
    margin-bottom: 12px;
    line-height: 1.4;
    word-break: break-word; /* Force le texte long à aller à la ligne */
}

/* Zone d'écriture */
.chat-input-area {
    padding: 10px;
    display: flex;
    background: white;
}

#user-input {
    flex: 1;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

#user-input:focus {
    border-color: #ffa500;
}

.chat-submit {
    background: #ffa500;
    color: white;
    border: none;
    padding: 8px 14px;
    margin-left: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
