/* =============================================================
   CHATBOT UI - Widget Chat Tư Vấn AI
   ============================================================= */

/* ---------- Nút mở Chatbot ---------- */
.chatbot-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0a1628;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(10, 22, 40, 0.15);
    z-index: 100005;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    background: #d4a843;
    box-shadow: 0 4px 15px rgba(212, 168, 67, 0.4);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chatbot-toggle .close-icon {
    display: none;
}

.chatbot-toggle.active .chat-icon {
    display: none;
}

.chatbot-toggle.active .close-icon {
    display: block;
}

/* ---------- Chatbox Container ---------- */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 480px;
    max-height: calc(100vh - 240px); 
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(10, 22, 40, 0.15);
    z-index: 100004;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.2s ease;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.chatbot-container.active {
    display: flex;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Header ---------- */
.chatbot-header {
    background: #0a1628;
    border-bottom: 2px solid #d4a843;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header-info h4 {
    color: #fff;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.chatbot-header-info span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.chatbot-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 4px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ---------- Messages Area ---------- */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* ---------- Message Bubbles ---------- */
.chat-message {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message .msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.bot .msg-avatar {
    background: #0a1628;
    color: #fff;
}

.chat-message.user .msg-avatar {
    background: #f8f4ee;
    color: #0a1628;
}

.chat-message .msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-message.bot .msg-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chat-message.user .msg-bubble {
    background: #1a3a6e;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* ---------- Typing Indicator ---------- */
.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 10px 14px;
    background: #fff;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.typing-indicator.active {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator .dot {
    width: 7px;
    height: 7px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); background: #ccc; }
    30% { transform: translateY(-6px); background: #1a3a6e; }
}

/* ---------- Suggestions ---------- */
.chatbot-suggestions {
    padding: 8px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.suggestion-chip {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 12px;
    color: #1a3a6e;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: #1a3a6e;
    color: #fff;
    border-color: #1a3a6e;
}

/* ---------- Input Area ---------- */
.chatbot-input {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #eee;
    background: #fff;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input input:focus {
    border-color: #1a3a6e;
}

.chatbot-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a3a6e;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chatbot-input button:hover {
    transform: scale(1.05);
}

.chatbot-input button svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 140px);
        right: 10px;
        bottom: 80px;
        border-radius: 12px;
    }

    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 52px;
        height: 52px;
    }
}

/* CHANGES: Thay thế toàn bộ màu gradient tím/xanh của chatbot sang màu phẳng Navy (#0a1628 và #1a3a6e), đổi hover sang màu Vàng Gold (#d4a843), xóa keyframe và hiệu ứng nhấp nháy pulse-chat liên tục, điều chỉnh box-shadow và giảm border-radius về 12px */
