/* ── Chatbot Widget ────────────────────────────────────────────────────────── */

#chatbot-btn {
    position: fixed;
    bottom: 102px;
    right: 45px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 6px 24px rgba(196,18,48,0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

#chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 32px rgba(196,18,48,0.55);
}

#chatbot-widget {
    position: fixed;
    bottom: 158px;
    right: 30px;
    width: 360px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#chatbot-widget.chatbot-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: var(--dark);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.chatbot-name {
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
}

.chatbot-status {
    font-size: 0.73rem;
    color: rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.chatbot-dot {
    width: 7px;
    height: 7px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
}

#chatbot-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    transition: color 0.2s;
}
#chatbot-close:hover { color: #fff; }

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 260px;
    max-height: 340px;
}

.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.chatbot-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 0.855rem;
    line-height: 1.55;
    white-space: pre-line;
    word-break: break-word;
}

.chatbot-msg.bot {
    background: #f3f4f6;
    color: #1a1a2e;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.chatbot-msg.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

/* Typing indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 11px 14px;
    background: #f3f4f6;
    border-radius: 12px;
    border-bottom-left-radius: 3px;
    align-self: flex-start;
}

.chatbot-typing span {
    width: 7px;
    height: 7px;
    background: #b0b4bc;
    border-radius: 50%;
    animation: chatTyping 1.2s ease-in-out infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.18s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes chatTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* Quick replies */
.chatbot-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
}

.chatbot-quick-btn {
    background: none;
    border: 1px solid rgba(196,18,48,0.3);
    color: var(--primary);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.chatbot-quick-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Input area */
.chatbot-input-area {
    padding: 10px 14px 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 8px 15px;
    font-size: 0.855rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Open Sans', sans-serif;
    color: #1a1a2e;
}
#chatbot-input:focus { border-color: var(--primary); }
#chatbot-input::placeholder { color: #aaa; }

#chatbot-send {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
    font-size: 0.85rem;
}
#chatbot-send:hover { background: #9c2435; transform: scale(1.08); }

/* Mobile */
@media (max-width: 575.98px) {
    #chatbot-widget {
        right: 12px;
        bottom: 142px;
        width: calc(100vw - 24px);
    }
    #chatbot-btn {
        right: 16px;
        bottom: 96px;
        width: 40px;
        height: 40px;
    }
}
