/* Chatbot Declic - Style moderne bleu dégradé */
#chatbot-declic-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 4px 18px rgba(35,99,235,0.10), 0 1.5px 6px rgba(0,0,0,0.08);
    border: 1.5px solid #eaeaea;
    transition: box-shadow 0.2s, background 0.2s;
    padding: 0;
}
.chatbot-bubble-icon {
    font-size: 2.2em !important;
    user-select: none;
    color: #2563eb !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
#chatbot-declic-bubble:hover {
    box-shadow: 0 8px 32px rgba(35,99,235,0.18), 0 1.5px 6px rgba(0,0,0,0.12);
    background: #f7fafd;
}
/* Animation wiggle de la bulle au hover */
@keyframes chatbot-bubble-wiggle {
  0% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(-8deg) scale(1.08); }
  30% { transform: rotate(7deg) scale(1.08); }
  45% { transform: rotate(-5deg) scale(1.06); }
  60% { transform: rotate(4deg) scale(1.04); }
  75% { transform: rotate(-2deg) scale(1.02); }
  100% { transform: rotate(0deg) scale(1); }
}
#chatbot-declic-bubble:hover .chatbot-bubble-icon {
  animation: chatbot-bubble-wiggle 0.6s cubic-bezier(.36,1.56,.64,1) 1;
}
#chatbot-declic-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9999;
    width: 350px;
    max-width: 95vw;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(35,99,235,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1.5px solid #eaeaea;
    backdrop-filter: blur(2px);
}
#chatbot-messages {
    height: 300px;
    overflow-y: auto;
    overflow-x: hidden; /* Empêche le scroll horizontal */
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    font-size: 1em;
}
#chatbot-messages div {
    margin-bottom: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 1.05em;
    box-shadow: 0 2px 8px rgba(35,99,235,0.07);
    word-break: break-word; /* Coupe les mots trop longs */
    max-width: 95%; /* Empêche de dépasser le container */
}
.chatbot-user-msg {
    background: #fff !important;
    color: #222 !important;
    text-align: right !important;
    align-self: flex-end;
    font-weight: 500;
    border: 1px solid #eaeaea;
}
.chatbot-bot-msg {
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%) !important;
    color: #fff !important;
    text-align: left !important;
    align-self: flex-start;
    font-weight: 500;
    border: 1px solid #2563eb;
}
/* Reset box-sizing et police pour tout le chatbot */
#chatbot-declic-container, #chatbot-declic-container * {
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
}
#chatbot-declic-form {
    display: flex;
    gap: 5px;
    padding: 10px;
    align-items: center;
}
#chatbot-declic-input {
    flex: 1;
    border-radius: 14px;
    border: 1px solid #eaeaea;
    padding: 12px 16px;
    font-size: 1.1em;
    line-height: 1.4;
    background: #f7fafd;
    color: #222;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    transition: border 0.2s;
}
#chatbot-declic-input:focus {
    border: 1.5px solid #2563eb;
    outline: none;
    background: #fff;
}
#chatbot-declic-form button[type="submit"] {
    border-radius: 14px;
    border: none;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
    color: #fff;
    padding: 12px 22px;
    font-size: 1.1em;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    min-width: 80px;
    margin-left: 4px;
    transition: background 0.2s;
}
#chatbot-declic-form button[type="submit"]:hover {
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
}

/* Actions du chatbot (bouton vider) */
#chatbot-declic-actions {
    display: flex;
    justify-content: flex-end;
    padding: 5px 10px 0 10px;
}
#chatbot-clear-conversation {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
}
#chatbot-clear-conversation:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

#chatbot-declic-loading {
    display: none;
    padding: 10px;
    color: #2563eb;
    font-size: 0.95em;
    letter-spacing: 2px;
}
#chatbot-declic-loading .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background: #2563eb;
    border-radius: 50%;
    opacity: 0.5;
    animation: chatbot-dot-bounce 1s infinite both;
}
#chatbot-declic-loading .dot:nth-child(2) { animation-delay: 0.2s; }
#chatbot-declic-loading .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatbot-dot-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-7px); opacity: 1; }
}
#chatbot-declic-close { display: none; }
#chatbot-declic-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(35,99,235,0.08);
    z-index: 9998;
    display: none;
    animation: chatbot-fadein 0.2s;
}
@media (max-width: 400px) {
    #chatbot-declic-container {
        width: 98vw;
        right: 1vw;
        left: 1vw;
        min-width: unset;
    }
    #chatbot-declic-form {
        flex-direction: column;
        gap: 8px;
    }
    #chatbot-declic-form button[type="submit"] {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }
}
#chatbot-declic-container.chatbot-fadein {
    animation: chatbot-fadein 0.25s cubic-bezier(.4,1.6,.6,1) forwards;
}
#chatbot-declic-container.chatbot-fadeout {
    animation: chatbot-fadeout 0.22s cubic-bezier(.4,1.6,.6,1) forwards;
}
@keyframes chatbot-fadein {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chatbot-fadeout {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(40px) scale(0.95); }
}
