/* ── MOTUS Chatbot Widget ───────────────────────────── */

#motus-chat-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    background: #0D1F3C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(13,31,60,0.4);
    border: 2px solid #F5C518;
    transition: transform 0.2s, box-shadow 0.2s;
}
#motus-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(13,31,60,0.5);
}
#motus-chat-btn svg { width: 26px; height: 26px; }

/* Notification dot */
#motus-chat-dot {
    position: absolute;
    top: -3px; right: -3px;
    width: 14px; height: 14px;
    background: #F5C518;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.2); }
}

/* Chat Window */
#motus-chat-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 360px;
    height: 540px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}
#motus-chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
#motus-chat-header {
    background: #0D1F3C;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.chat-avatar {
    width: 40px; height: 40px;
    background: #1E9EC8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.chat-header-info h4 {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    font-family: 'Inter', sans-serif;
}
.chat-header-info span {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
}
.chat-online {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.chat-online::before {
    content: '';
    width: 7px; height: 7px;
    background: #4ade80;
    border-radius: 50%;
}
#motus-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}
#motus-chat-close:hover { color: #fff; }

/* Messages */
#motus-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}
#motus-chat-messages::-webkit-scrollbar { width: 4px; }
#motus-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: msgIn 0.2s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
}
.chat-msg.bot  .msg-bubble { background: #fff; color: #111; border: 1px solid #e5e7eb; border-radius: 4px 12px 12px 12px; }
.chat-msg.user .msg-bubble { background: #0D1F3C; color: #fff; border-radius: 12px 4px 12px 12px; }

.msg-avatar {
    width: 28px; height: 28px;
    background: #0D1F3C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #F5C518;
    font-weight: 700;
    flex-shrink: 0;
    align-self: flex-end;
    font-family: 'Inter', sans-serif;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px 12px 12px 12px;
}
.typing-dot {
    width: 7px; height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-6px); }
}

/* Calendly Button in Chat */
.calendly-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #F5C518;
    color: #0D1F3C;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 8px;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s;
}
.calendly-btn:hover { background: #e0b510; }

/* Input Area */
#motus-chat-input-area {
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
#motus-chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: none;
    line-height: 1.4;
    max-height: 80px;
    transition: border-color 0.2s;
}
#motus-chat-input:focus { border-color: #1E9EC8; }
#motus-chat-send {
    width: 40px; height: 40px;
    background: #0D1F3C;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    align-self: flex-end;
}
#motus-chat-send:hover { background: #1E9EC8; }
#motus-chat-send svg { width: 18px; height: 18px; }

/* Mobile */
@media (max-width: 480px) {
    #motus-chat-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 90px;
        height: 70vh;
    }
}
