/* Bouton flottant du chatbot */
.chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent-red, #E91E63);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chatbot-toggler:hover {
    transform: scale(1.1);
}

.chatbot-toggler span {
    position: absolute;
    transition: opacity 0.3s ease;
}

.chatbot-toggler .icon-close {
    opacity: 0;
}

.chatbot-open .chatbot-toggler .icon-chat {
    opacity: 0;
}

.chatbot-open .chatbot-toggler .icon-close {
    opacity: 1;
}

/* Conteneur principal du chatbot */
.chatbot {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.chatbot-open .chatbot {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* En-tête */
.chatbot-header {
    background-color: var(--primary-cyan, #00A8CC);
    color: white;
    padding: 15px 20px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

/* Zone des messages */
.chatbox {
    padding: 15px;
    height: 350px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f9f9f9;
}

/* Styles des bulles */
.chat {
    display: flex;
    align-items: flex-end;
}

.chat p {
    margin: 0;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    max-width: 80%;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Message entrant (Bot) */
.chat-incoming p {
    background-color: #e2e8f0;
    color: #333;
    border-bottom-left-radius: 3px;
}

/* Message sortant (Utilisateur) */
.chat-outgoing {
    justify-content: flex-end;
}

.chat-outgoing p {
    background-color: var(--accent-red, #E91E63);
    color: white;
    border-bottom-right-radius: 3px;
}

/* Zone de saisie */
.chat-input-container {
    padding: 10px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
}

.chat-input-container textarea {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    resize: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    height: 40px;
}

.chat-input-container button {
    background: transparent;
    border: none;
    color: var(--primary-cyan, #00A8CC);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.2s;
}

.chat-input-container button:hover {
    color: var(--accent-red, #E91E63);
}

/* Animation d'attente */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 450px) {
    .chatbot {
        right: 15px;
        bottom: 80px;
        width: calc(100% - 30px);
        height: 450px;
    }
    .chatbox {
        height: 100%;
    }
}
