/* Widget agent IA — TopTop Clean */
#chatbot-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Poppins', sans-serif;
}

.chat-teaser {
    background: white;
    color: #333;
    padding: 10px 18px;
    border-radius: 15px;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    animation: chatFadeInBounce 0.8s ease;
    cursor: pointer;
}

.chat-teaser::after {
    content: "";
    position: absolute;
    bottom: -8px;
    right: 20px;
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: white transparent transparent;
}

.teaser-close-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 18px;
    margin-left: 8px;
    cursor: pointer;
}

.chat-bubble-launcher {
    width: 60px;
    height: 60px;
    background: #246b94;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    cursor: pointer;
    position: relative;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-bubble-launcher:hover {
    transform: scale(1.08);
}

.chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #fff;
    color: #d97d66;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-popup-window {
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 5px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.chat-header-custom {
    background: linear-gradient(135deg, #66b7d9, #1c82a7);
    padding: 15px;
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

.btn-close-header {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.btn-close-header:hover {
    opacity: 1;
}

.chat-messages-area {
    flex: 1;
    padding: 16px;
    background: #f8f9fa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-bubble {
    max-width: 92%;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-msg-bubble {
    align-self: flex-start;
    background: white;
    padding: 12px 14px;
    border-radius: 15px 15px 15px 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    color: #444;
}

.user-msg-bubble {
    align-self: flex-end;
    background: linear-gradient(135deg, #0B5E7E, #1A7F9E);
    color: #fff;
    padding: 12px 14px;
    border-radius: 15px 15px 4px 15px;
}

.typing-indicator {
    opacity: 0.8;
    font-style: italic;
    font-size: 0.85rem;
}

.chat-typing {
    display: flex;
    gap: 5px;
    padding: 14px 16px !important;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    background: #9bb5c4;
    border-radius: 50%;
    animation: chatTypingDot 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatTypingDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.btn-outline-custom {
    border: 1px solid #3183af;
    color: #0B5E7E;
    border-radius: 10px;
    background: white;
    font-weight: 500;
    font-size: 0.85rem;
}

.btn-outline-custom:hover {
    background: #0B5E7E;
    color: white;
    border-color: #0B5E7E;
}

.chat-input-footer {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.send-msg-btn {
    background: none;
    border: none;
    color: #0B5E7E;
    font-size: 1.4rem;
    margin-left: 10px;
    cursor: pointer;
}

.send-msg-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@keyframes chatFadeInBounce {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    70% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

#chatbot-container .d-none {
    display: none !important;
}

@media (max-width: 575.98px) {
    #chatbot-container {
        right: 12px;
        bottom: 12px;
    }
    .chat-popup-window {
        width: calc(100vw - 24px);
        height: min(520px, 75vh);
    }
}
