/* Container tổng */
#gab-chat-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Nút bấm Icon Bot */
#gab-toggle {
    width: 120px;
    height: 120px;
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

#gab-toggle:hover {
    transform: scale(1.1) rotate(5deg);
}

#gab-toggle img {
    width: 100%;
    height: auto;
}

/* Khung Chat */
#gab-chat-box {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 350px;
    height: 450px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* Header của khung chat */
#gab-chat-header {
    background: #f8f9fa;
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

#gab-chat-header img {
    width: 30px;
    margin-right: 10px;
}

#gab-chat-header span {
    font-weight: bold;
    color: #fff;
}

/* Vùng hiển thị tin nhắn */
#gab-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #fdfdfd;
}

/* Vùng nhập liệu */
#gab-input-container {
    padding: 10px;
    display: flex;
    gap: 5px;
    border-top: 1px solid #eee;
}

#gab-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
}

#gab-send {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
}
.gab-msg { margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; line-height: 1.4; }
.user-msg { background: #e1f5fe; align-self: flex-end; text-align: right; margin-left: 20%; }
.bot-msg { background: #f1f0f0; align-self: flex-start; margin-right: 20%; }
#gab-messages { display: flex; flex-direction: column; }

.gab-msg {
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 10px 14px;
    font-size: 14px;
}
.bot-msg strong {
    color: #d32f2f; /* Làm nổi bật các ý chính hoặc số điện thoại */
}
.gab-msg strong {
    color: #e31a27; /* Màu đỏ thương hiệu Thép Thái Bình */
    font-size: 1.1em;
    background: #fff5f5;
    padding: 0 4px;
    border-radius: 3px;
}
/* Tổng thể khung chat */
#gab-chat-box {
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 380px; /* Tăng độ rộng chút cho thoáng */
    height: 550px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: all 0.3s ease;
}

/* Header - Thanh tiêu đề */
#gab-chat-header {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 17px; /* Chữ header lớn hơn */
}

#gab-chat-header img {
    width: 30px;
    height: 30px;
    margin-right: 12px;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
}

/* Nút đóng - Căn lề phải chuẩn xác */
#gab-close-chat {
    margin-left: auto; /* Đẩy sang tận cùng bên phải */
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

#gab-close-chat:hover {
    background: rgba(255,255,255,0.4);
}

/* Nội dung tin nhắn */
#gab-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Style chung cho bong bóng tin nhắn */
.gab-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 16px; /* Font chữ lớn hơn dễ đọc */
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

/* Tin nhắn của Bot */
.bot-msg {
    align-self: flex-start;
    background: #ffffff;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Tin nhắn của Người dùng */
.user-msg {
    align-self: flex-end;
    background: #1a73e8;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* Làm nổi bật số điện thoại/Zalo trong tin nhắn Bot */
.bot-msg strong {
    color: #d32f2f;
    font-weight: 700;
    background: #fff0f0;
    padding: 0 4px;
    border-radius: 4px;
}

/* Khu vực nhập liệu */
#gab-input-container {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#gab-input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 12px 15px;
    border-radius: 25px;
    outline: none;
    font-size: 15px;
    transition: border 0.3s;
}

#gab-input:focus {
    border-color: #1a73e8;
}

#gab-send {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#gab-send:hover {
    background: #0d47a1;
}

/* Thanh cuộn (Scrollbar) đẹp hơn */
#gab-messages::-webkit-scrollbar {
    width: 6px;
}
#gab-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
#gab-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth; /* Thêm dòng này để cuộn mượt hơn */
}

#gab-close-chat {
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 9999;
}

/* Style cho dòng chữ thương hiệu iWeb */
.gab-branding {
    padding: 5px 10px;
    font-size: 11px; /* Nhỏ gọn */
    color: #999;
    text-align: center;
    background: #fff;
    border-top: 1px solid #f9f9f9;
    letter-spacing: 0.5px;
}

.gab-branding a {
    color: #1a73e8; /* Màu xanh thương hiệu */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.gab-branding a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* Đảm bảo khung chat đủ chỗ chứa dòng chữ mới */
#gab-chat-box {
    height: auto; 
    max-height: 580px; /* Tăng nhẹ chiều cao để không bị che khuất */
}

/* Giao diện các nút trả lời nhanh (Quick Replies) */
.gab-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 5px 10px 15px 10px;
}

.gab-qr-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.gab-qr-btn:hover {
    background: #0073aa; /* Màu xanh chuẩn của WordPress/Zalo */
    color: #ffffff;
    border-color: #0073aa;
}