﻿/* ========== NÚT CHAT NỔI ========== */

.chatbot-floating-btn {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #0d6efd;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);

}

    .chatbot-floating-btn:hover {
        background: #0b5ed7;
    }

.chatbot-btn-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
}

    .chatbot-btn-icon svg {
        width: 20px;
        height: 20px;
    }

.chatbot-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.chatbot-label-main {
    font-size: 13px;
    font-weight: 600;
}

.chatbot-label-sub {
    font-size: 11px;
    opacity: .9;
}

.chatbot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .4);
}

/* ========== HỘP CHAT ========== */

/* HỘP CHAT – KHUNG NGOÀI */
/* Hộp chat – khung trắng */
.chatbot-box {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 380px;
    max-width: calc(100% - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(148, 163, 184, 0.25);
    z-index: 9999;
    display: flex; /* bắt buộc là flex */
    flex-direction: column; /* header – messages – input xếp dọc */
    overflow: hidden;
}

/* Header */

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #0f6efd, #3b82f6);
    color: #fff;
}

.chatbot-header-title {
    display: flex;
    flex-direction: column;
}

.chatbot-header-main {
    font-size: 15px;
    font-weight: 700;
}

.chatbot-header-sub {
    font-size: 12px;
    opacity: .9;
    margin-top: 1px;
}

.chatbot-header-close {
    border: none;
    background: rgba(15, 23, 42, 0.15);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 99px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

/* VÙNG TIN NHẮN – chiếm phần còn lại, có scroll riêng */
.chatbot-messages {
    flex: 1 1 auto; /* chiếm toàn bộ khoảng trống còn lại */
    min-height: 0; /* cho phép co lại để cuộn */
    padding: 12px 14px;
    overflow-y: auto; /* cuộn dọc */
    background: #f9fafb;
}

/* Thanh nhập và nút gửi */
.chatbot-input-area {
    flex: 0 0 auto; /* cố định ở đáy khung */
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    background: #ffffff;
}

    .chatbot-input-area .form-control {
        font-size: 14px;
        border-radius: 999px 0 0 999px;
        border-right: none;
    }
/* Tuỳ chỉnh nhẹ nút gửi */

.chatbot-send-btn {
    border-radius: 0 999px 999px 0;
    padding: 0 18px;
    font-weight: 600;
}

/* Mobile: hộp chat gần full chiều ngang, tính lại bottom một chút */

@media (max-width: 576px) {
    .chatbot-box {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 80px; /* chỉnh riêng cho mobile nếu thích */
        max-height: calc(100vh - 120px);
    }

    .chatbot-floating-btn {
        right: 16px;
        bottom: 16px;
    }
}
