html,
suggestions body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif,
            "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    /* Không cuộn body */
    background-color: #fafafa;
}



/* Khu vực chat */
.chat-area {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-container {
    width: 100%;
    max-width: 768px;
    /* đảm bảo có chiều cao tối thiểu ban đầu */
    flex: 1;
    max-height: 100%;
    overflow-y: auto;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
}


/* Ẩn thanh cuộn ở Chrome, Safari, Opera */
.chat-container::-webkit-scrollbar {
    display: none;
}


.messages {
    display: flex;
    gap: 5px;
    overflow-y: auto;
    scroll-behavior: smooth;
    flex-direction: column;
}

/* Ẩn thanh cuộn dọc */
.messages::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Cải thiện trải nghiệm trên các trình duyệt khác */
.messages {
    -ms-overflow-style: none;
    /* Ẩn thanh cuộn trên IE */
    scrollbar-width: none;
    /* Ẩn thanh cuộn trên Firefox */
}

.greeting-message {
    font-size: 18px;
    /* hoặc to hơn nữa nếu cần */
    /* font-weight: bold; */
}

/* Thanh nhập chat */
.chat-input-area {
    width: 768px;
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0px 10px 5px 10px;
    background: #fafafa;
    z-index: 1000;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 30px;
    box-shadow: 3px 6px 8px -4px rgba(0, 0, 0, 0.5);
}

/* Input và nút gửi */
.chat-input-container {
    flex: 1;
    min-width: 0;
    display: flex;
    border-radius: 30px;
}

.chat-input {
    /* Chiều cao cố định */
    flex: 1;
    min-width: 0;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif,
            "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    padding: 4px 8px;
    box-sizing: border-box;
    border: none;
    border-radius: 8px;
    background: #fafafa;
    outline: none;
    min-height: 32px;
    max-height: 80px;
    line-height: 1.4;
    height: auto;
    max-height: 200px;
    overflow-y: auto;
    resize: none;
    font-size: 14px;
    border-radius: 30px;
    /* Tạo không gian giữa textarea và icon */
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-btn,
.send-btn {
    background: #e4e4e4;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    font-size: 14px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0057a6;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.record-btn:hover i,
.send-btn:hover i {
    color: #000;
}

/* Nút xóa */
.delete-button-container {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0057a6;
    font-size: 16px;
    background: #e4e4e4;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.delete-button-container:hover {
    color: #000000;
}


/* Tin nhắn user và bot */
.user-message {
    align-self: flex-end;
    max-width: 100%;
    background-color: #daf4ff;
    color: #333;
    padding: 5px 10px;
    border-radius: 20px 20px 0 20px;
    word-break: break-word;
}

.bot-message {
    align-self: flex-start;
    line-height: 1.7;
    max-width: 100%;
    color: #333;
    /* padding: 5px 0px; */
    border-radius: 20px 20px 20px 0;
    word-break: break-word;
}

#suggestions {
    width: 100%;
    max-width: 768px;
    gap: 10px;
    border-radius: 20px;
    /* border: 1px solid #ececec; */
    overflow-y: auto;
    background-color: #fafafa;
    white-space: nowrap;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif,
            "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    /* Đảm bảo nội dung không xuống dòng */
    overflow-x: auto;
    /* Cho phép cuộn ngang khi nội dung dài */
}

#suggestions::-webkit-scrollbar {
    display: none;
}

.suggestion-button {
    padding: 10px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: inline-flex;
    align-items: center;
    border: none;
    background-color: #e9e5e5;
    transition: background-color 0.3s ease;
    word-wrap: break-word;
    /* Cho phép dòng văn bản bị bẻ gãy khi quá dài */
}

.suggestion-button:hover {
    background-color: #e0e0e0;
}

.suggestion-button:focus {
    outline: none;
}

button.disabled,
.delete-button-container.disabled,
.suggestion-button.disabled,
.disabled,
.disabled i {
    opacity: 0.5;
    pointer-events: none !important;
    cursor: not-allowed;
}


h3 {
    margin-bottom: 0;
    padding: 0;
}

.suggestion-button.disabled {
    pointer-events: none !important;
    opacity: 0.5;
    cursor: not-allowed;
}

.disabled {
    pointer-events: none !important;
    opacity: 0.5;
    cursor: not-allowed;
}

.disabled i {
    pointer-events: none !important;
}

.logo-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
    animation: fadeIn 1s ease-in-out;
}

.logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.logo-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* Làm logo tròn */
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.logo-item img:hover {
    transform: scale(1.1);
    /* Hover phóng to nhẹ */
}

.logo-item p {
    margin-top: 8px;
    font-size: 12px;
    text-align: center;
    color: #333;
}

/* Hiệu ứng mờ dần khi vào */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */

/* ----- Các phần CSS phía trên giữ nguyên ----- */

/* Responsive tổng hợp */
@media (max-width: 768px) {

    /* Khung input gọn hơn */
    .logo-image img {
        height: 45px !important;
    }

    #input-section {
        padding: 8px 12px;
        border-radius: 20px;
    }

    .chat-terabox {
        padding: 4px 8px;
        border-radius: 16px;
    }

    .chat-input {
        font-size: 13px;
        padding: 3px 6px;
        border-radius: 12px;
    }

    .chat-action-row {
        padding-top: 4px;
        gap: 8px;
    }

    .delete-button-container,
    .record-btn,
    .send-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 4px;
    }

    .chat-actions {
        gap: 6px;
    }

    .chat-actions i,
    .delete-button-container i {
        font-size: 14px;
    }

    /* Responsive nhỏ hơn 375px */
    @media (max-width: 375px) {

        html,
        body {
            font-size: 13px;
        }

        .logo-image img {
            height: 40px !important;
        }

        .greeting-text h3 {
            font-size: 14px !important;
            margin-bottom: 4px !important;
        }

        .greeting-text p {
            font-size: 13px !important;
            padding: 0 10px !important;
            line-height: 1.4 !important;
        }

        #suggestions {
            height: 40px !important;
        }

        #suggestions .suggestion-button {
            flex: 0 0 100% !important;
            font-size: 12px !important;
            padding: 0px 14px !important;
        }

        .suggestion-carousel .suggestion-button {
            flex: 0 0 calc(33.4% - 5px) !important;
            font-size: 11px !important;
            padding: 6px !important;
            min-height: 60px !important;
            border-radius: 8px !important;
            line-height: 1.3 !important;
        }

        .chat-input {
            font-size: 13px !important;
            padding: 5px 8px !important;
            border-radius: 16px !important;
            min-height: 32px !important;
            max-height: 80px !important;
        }

        .delete-button-container,
        .record-btn,
        .send-btn {
            width: 28px !important;
            height: 28px !important;
            font-size: 12px !important;
        }

        .record-btn i,
        .send-btn i,
        .delete-button-container i {
            font-size: 12px !important;
        }

        .bot-message,
        .user-message {
            font-size: 13px;
        }

        .chat-container {
            height: calc(100vh - 140px - 100px);
        }
    }
}



.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-dropdown .selected-language img {
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-radius: 50%;
}

.language-dropdown .language-options {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 40px;
    left: 0;
    background: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    padding: 5px;
    border-radius: 10px;
}

.language-dropdown .language-options img {
    width: 24px;
    height: 24px;
    margin: 5px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s;
}

.language-dropdown .language-options img:hover {
    transform: scale(1.1);
}

.language-dropdown.show .language-options {
    display: flex;
}

.logo-center {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: center;
    position: relative;
}

.logo-wrapper {
    position: relative;
}

.logo-wrapper .language-dropdown {
    position: absolute;
    top: 0;
    right: 15px;
    /* hoặc 16px tùy bạn muốn cách bao nhiêu */
    z-index: 10;
}

.logo-image img {
    height: 70px;
    display: block;
    margin: 0 auto;
}

.greeting-text {
    text-align: center;
    color: #000000;
}

.greeting-text h3 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.greeting-text p {
    margin: 4px 0 4px 0;
    font-size: 16px;
}

/* css gợi ý */
.suggestion-carousel {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0px 0px 0px;
    max-width: 768px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.suggestion-carousel::-webkit-scrollbar {
    height: 6px;
}

.suggestion-carousel .suggestion-button {
    flex: 0 0 calc(25% - 5px);
    /* 4 box trên 1 hàng */
    background: white;
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
    text-align: left;
    /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); */
    cursor: pointer;
    scroll-snap-align: start;
    min-height: 80px;
    transition: background-color 0.2s;
    word-wrap: break-word;
}

.suggestion-carousel .suggestion-button:hover {
    background-color: #f2f2f2;
}

/* ===== GRID BỐ CỤC MỚI: 4 VÙNG ===== */
.chat-page-grid {
    display: grid;
    height: 100dvh;
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
    grid-template-rows:
        auto
        /* Greeting */
        1fr
        /* Chat content */
        auto
        /* Suggestions */
        auto;
    /* Input chat */
    overflow: hidden;
    background-color: #fafafa;
}

/* Greeting */
#greeting-section {
    padding: 7px 0;
    background-color: #fafafa;
    /* box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05); */
    z-index: 1;
}

/* Chat Content */
#chat-section {
    padding: 0 6px;
    background-color: #fafafa;
    position: relative;
    z-index: 0;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* iOS */
    scroll-behavior: auto;
    /* Tắt smooth để vuốt tay không bị delay */
    overscroll-behavior: contain;
    /* Tránh ảnh hưởng cuộn toàn trang */
    touch-action: pan-y;
}

/* Ẩn thanh cuộn trên tất cả trình duyệt */
.chat-section {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* Internet Explorer/Edge */
}

.chat-section::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Suggestions */
#suggestion-section {
    padding: 4px 12px;
    background-color: #fafafa;
    overflow-x: auto;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Input */
#input-section {
    padding: 12px 16px;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #eee;
    z-index: 2;
    border-radius: 30px;
    transition: box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Giao diện giới hạn chiều rộng */
.chat-section,
#suggestion-section,
#input-section {
    max-width: 768px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Chat container bên trong */


/* Giao diện thanh nhập */
.chat-terabox {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 20px;
    padding: 6px 8px;
    box-sizing: border-box;
    transition: border 0.2s ease;
    border: 1px solid #ccc;
    width: 100%;
    max-width: 768px;
}

.chat-terabox:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    font-size: 14px;
    padding: 4px 8px;
    outline: none;
    color: #333;
    font-family: inherit;
    min-height: 32px;
    max-height: 80px;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Hàng nút bên dưới */
.chat-action-row {
    display: flex;
    justify-content: space-between;
    /* tách 2 bên */
    align-items: center;
    padding-top: 4px;
    width: 100%;
    max-width: 768px;
    box-sizing: border-box;
}


/* Nút gửi, ghi âm, xóa */
.chat-actions button,
.delete-button-container {
    background-color: #ffffff;
    border: 1px solid #ccc;
    color: #333;
    width: 38px;
    height: 38px;
    margin-left: 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.chat-actions button:hover,
.delete-button-container:hover {
    background-color: #f0f0f0;
    border-color: #999;
    color: #000;
}

.chat-actions i,
.delete-button-container i {
    font-size: 16px;
}

/* Ẩn layout cũ */
.chat-input-area {
    display: none !important;
}