/**
 * public/css/internal-chat-widget.css
 * Giao diện Khung Chat Nội Bộ Doanh Nghiệp (100% Độc lập, Đồng bộ thiết kế hệ thống)
 */

/* ============================================================
   1. FLOATING BUTTON
   ============================================================ */
.ic-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 6px 18px -3px rgba(37, 99, 235, 0.45), 0 4px 8px -4px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.ic-floating-btn:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 10px 22px -4px rgba(37, 99, 235, 0.55), 0 6px 10px -4px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.ic-floating-btn:active {
    transform: translateY(0) scale(0.96);
}

.ic-floating-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.ic-floating-btn-text {
    display: none;
}

.ic-floating-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: ic-pulse 2s infinite;
}

.ic-floating-badge.hidden {
    display: none !important;
}

@keyframes ic-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* ============================================================
   2. CHAT WINDOW CONTAINER
   ============================================================ */
.ic-window {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: 420px;
    height: 600px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99995;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #0f172a;
    transition: width 0.25s ease, height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
}

.ic-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Minimized State (Ưu tiên tuyệt đối ngay cả khi đang có .expanded) */
.ic-window.minimized,
.ic-window.minimized.expanded,
.ic-window.expanded.minimized {
    width: 320px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.28) !important;
    cursor: pointer;
    overflow: hidden !important;
}

.ic-window.minimized .ic-body,
.ic-window.minimized.expanded .ic-body,
.ic-window.expanded.minimized .ic-body {
    display: none !important;
}

.ic-window.minimized .ic-header,
.ic-window.minimized.expanded .ic-header,
.ic-window.expanded.minimized .ic-header {
    height: 52px !important;
    cursor: pointer;
}

/* Expanded Split Mode (chỉ có hiệu lực khi KHÔNG bị thu nhỏ) */
.ic-window.expanded:not(.minimized) {
    width: 820px !important;
    height: 660px !important;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
}

.ic-window.expanded:not(.minimized) .ic-body {
    display: flex !important;
}

.ic-window.expanded:not(.minimized) .ic-sidebar {
    display: flex !important;
    width: 300px !important;
    flex-shrink: 0 !important;
}

.ic-window.expanded:not(.minimized) .ic-chat-pane {
    display: flex !important;
    flex: 1 !important;
}

.ic-empty-chat-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    text-align: center;
    padding: 30px;
    font-size: 13px;
    gap: 8px;
    margin: auto;
    user-select: none;
}

.ic-empty-chat-pane-icon {
    font-size: 38px;
    opacity: 0.85;
}

.ic-search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #cbd5e1;
    color: #475569;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.ic-search-clear-btn:hover {
    background: #94a3b8;
    color: #ffffff;
}

/* ============================================================
   3. WINDOW HEADER
   ============================================================ */
.ic-header {
    height: 56px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    user-select: none;
}

.ic-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.ic-btn-back {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 6px;
    margin-left: -6px;
    border-radius: 8px;
    cursor: pointer;
}

.ic-btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
}

.ic-header-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    overflow: visible;
}

.ic-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #0f172a;
    background: #94a3b8;
}

.ic-status-dot.online {
    background: #10b981 !important;
}

.ic-header-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ic-header-title {
    font-size: 14.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.ic-header-sub {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ic-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ic-action-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ic-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* ============================================================
   4. WINDOW BODY & SPLIT LAYOUT
   ============================================================ */
.ic-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #f8fafc;
}

/* Side Pane (Conversations & Colleagues) */
.ic-sidebar {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    transition: width 0.2s ease;
}

.ic-window.expanded .ic-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.ic-window:not(.expanded) .ic-sidebar.hide-on-mobile {
    display: none;
}

.ic-window:not(.expanded) .ic-chat-pane.hide-on-mobile {
    display: none;
}

.ic-sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.ic-company-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ic-search-box {
    position: relative;
    width: 100%;
}

.ic-search-box input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12.5px;
    background: #f8fafc;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.ic-search-box input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.ic-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.ic-tabs {
    display: flex;
    padding: 8px 12px 0 12px;
    gap: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.ic-tab-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.ic-tab-btn:hover {
    color: #1e293b;
}

.ic-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.ic-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.ic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.ic-item:hover {
    background: #f1f5f9;
}

.ic-item.active {
    background: #e0f2fe;
}

.ic-item-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    flex-shrink: 0;
}

.ic-item-content {
    flex: 1;
    overflow: hidden;
}

.ic-item-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.ic-item-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ic-item-time {
    font-size: 10.5px;
    color: #94a3b8;
    flex-shrink: 0;
}

.ic-item-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ic-item-preview {
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 190px;
}

.ic-item.unread .ic-item-preview {
    color: #0f172a;
    font-weight: 700;
}

.ic-item-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 9999px;
    font-size: 10.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ic-item-del-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.ic-item:hover .ic-item-del-btn {
    display: inline-flex;
}

.ic-item-del-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* ============================================================
   5. CHAT PANE (Active Conversation)
   ============================================================ */
/* ============================================================
   5. CHAT PANE (Active Conversation) - Chuẩn Zalo PC & LiveChat
   ============================================================ */
.ic-chat-pane {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #eef0f3;
    position: relative;
    overflow: hidden;
}

.ic-messages-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #eef0f3; /* Nền xám xanh đặc trưng chuẩn Zalo PC & LiveChat */
    scroll-behavior: auto !important;
    box-sizing: border-box;
}

.ic-messages-area::-webkit-scrollbar {
    width: 6px;
}
.ic-messages-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.ic-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

/* Time Divider Badge (Mốc thời gian phân đoạn cuộc trò chuyện chuẩn Zalo) */
.ic-time-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px auto 8px auto;
    width: 100%;
    pointer-events: none;
    user-select: none;
}

.ic-time-divider span {
    background: #b6bec9;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    letter-spacing: 0.2px;
}

.ic-load-more-btn {
    align-self: center;
    background: #cbd5e1;
    color: #334155;
    border: none;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 9999px;
    cursor: pointer;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
}

.ic-load-more-btn:hover {
    background: #94a3b8;
    color: #ffffff;
}

/* Message Row Container (Thu gọn khoảng cách tối đa) */
.ic-msg-row {
    display: flex;
    width: 100%;
    position: relative;
    margin-bottom: 2px; /* Khoảng cách giữa các tin nhắn liên tiếp của cùng 1 người */
    box-sizing: border-box;
}

.ic-msg-row.is-last-in-group {
    margin-bottom: 12px !important; /* Khoảng cách giữa các nhóm người gửi khác nhau */
}

/* Sent (Tin nhắn của tôi - Phía bên phải) */
.ic-msg-row.sent {
    justify-content: flex-end;
}

/* Received (Tin nhắn nhận được từ đồng nghiệp - Phía bên trái) */
.ic-msg-row.received {
    justify-content: flex-start;
    gap: 8px;
}

/* Cột Avatar đồng nghiệp bên trái */
.ic-msg-avatar-col {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-top: 1px;
    user-select: none;
}

.ic-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
}

/* Khung chứa Bong bóng chat & Tiêu đề tên */
.ic-msg-bubble-wrap {
    max-width: 76%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ic-msg-row.sent .ic-msg-bubble-wrap {
    align-items: flex-end;
}

.ic-msg-row.received .ic-msg-bubble-wrap {
    align-items: flex-start;
}

/* Tên người gửi (Chỉ hiển thị 1 lần ở tin nhắn đầu tiên của nhóm) */
.ic-msg-sender-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 3px;
    margin-left: 3px;
    user-select: none;
    line-height: 1.2;
}

/* Bong bóng chat (Chuẩn màu LiveChat khách hàng / Zalo PC) */
.ic-bubble {
    padding: 8px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* Tin nhắn gửi đi (Sent): Nền xanh dương nhạt #e5efff, viền #d0e3ff, chữ #081c36 */
.ic-msg-row.sent .ic-bubble {
    background: #e5efff;
    color: #081c36;
    border: 1px solid #d0e3ff;
    border-top-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Tin nhắn nhận được (Received): Nền trắng #ffffff, viền #e5e7eb, chữ #081c36 */
.ic-msg-row.received .ic-bubble {
    background: #ffffff;
    color: #081c36;
    border: 1px solid #e5e7eb;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Nội dung text */
.ic-bubble-text {
    word-break: break-word;
    white-space: pre-wrap;
}

/* Thời gian và trạng thái tin nhắn bên trong bong bóng */
.ic-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 3px;
    font-size: 10.5px;
    color: #7589a3;
    line-height: 1;
    user-select: none;
}

.ic-bubble-time {
    font-size: 10.5px;
    color: #7589a3;
    opacity: 0.85;
}

.ic-bubble-status {
    color: #0068ff;
    font-weight: 700;
    font-size: 11px;
}

/* Tin nhắn đã thu hồi */
.ic-bubble.recalled {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px dashed #cbd5e1 !important;
    font-style: italic;
    font-size: 12.5px;
    box-shadow: none !important;
}

/* Sticker Bubble */
.ic-bubble.sticker-bubble {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

.ic-sticker-img {
    width: 105px;
    height: 105px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
    transition: transform 0.2s ease;
}

.ic-sticker-img:hover {
    transform: scale(1.08);
}

/* Image Bubble */
.ic-bubble.image-bubble {
    padding: 4px !important;
}

.ic-img-thumb {
    max-width: 240px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    transition: opacity 0.15s ease;
}

.ic-img-thumb:hover {
    opacity: 0.92;
}

/* File Bubble */
.ic-file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    margin-bottom: 2px;
    text-decoration: none;
    color: inherit;
}

.ic-msg-row.sent .ic-file-card {
    background: rgba(0, 104, 255, 0.06);
    border-color: rgba(0, 104, 255, 0.14);
    color: #081c36;
}

.ic-file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ic-file-meta {
    overflow: hidden;
}

.ic-file-name {
    font-weight: 700;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.ic-file-size {
    font-size: 10.5px;
    opacity: 0.8;
}

/* Hover Action Bar */
.ic-msg-actions {
    position: absolute;
    top: -14px;
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 2px 5px;
    gap: 2px;
    z-index: 10;
}

.ic-msg-row.sent .ic-msg-actions {
    right: 4px;
}

.ic-msg-row.received .ic-msg-actions {
    left: 4px;
}

.ic-msg-bubble-wrap:hover .ic-msg-actions {
    display: flex;
}

.ic-msg-act-btn {
    background: transparent;
    border: none;
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}

.ic-msg-act-btn:hover {
    background: #f1f5f9;
}

/* Reaction Summary Bar */
.ic-reactions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.ic-reaction-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    user-select: none;
}

.ic-reaction-chip.active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Typing Indicator */
.ic-typing-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
}

.ic-typing-indicator.active {
    display: flex;
}

.ic-typing-dots {
    display: flex;
    gap: 3px;
}

.ic-typing-dots span {
    width: 5px;
    height: 5px;
    background: #94a3b8;
    border-radius: 50%;
    animation: ic-bounce 1.4s infinite ease-in-out both;
}

.ic-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ic-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ic-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ============================================================
   6. INPUT BAR & STICKER PICKER
   ============================================================ */
.ic-input-bar {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    flex-shrink: 0;
}

.ic-input-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ic-tool-btn {
    background: transparent;
    border: none;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s ease;
}

.ic-tool-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.ic-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.ic-textarea {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13.5px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    max-height: 90px;
    min-height: 38px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
    background: #f8fafc;
}

.ic-textarea:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ic-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ic-send-btn:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.ic-send-btn:active {
    transform: scale(0.95);
}

/* Sticker Popover */
.ic-sticker-popover {
    position: absolute;
    bottom: 84px;
    left: 12px;
    width: 320px;
    height: 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.ic-sticker-popover.active {
    display: flex;
}

.ic-sticker-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px;
    gap: 4px;
}

.ic-stk-tab {
    padding: 4px 8px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
}

.ic-stk-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ic-sticker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ic-stk-item {
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.ic-stk-item:hover {
    transform: scale(1.15);
    background: #f1f5f9;
}

.ic-stk-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

/* Lightbox Modal */
.ic-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ic-lightbox.active {
    display: flex;
}

.ic-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.ic-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
}

/* Drag & Drop Overlay */
.ic-dropzone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 99, 235, 0.1);
    border: 2px dashed #2563eb;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #2563eb;
    z-index: 50;
    pointer-events: none;
}

.ic-dropzone.active {
    display: flex;
}

/* ============================================================
   7. RESPONSIVE FOR MOBILE (< 640px)
   ============================================================ */
@media (max-width: 640px) {
    .ic-floating-btn {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        padding: 0;
    }
    .ic-floating-btn-text {
        display: none;
    }
    .ic-window {
        bottom: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    .ic-btn-back {
        display: inline-flex !important;
    }
    /* Ẩn nút Chat Nội Bộ khi màn hình nhỏ đang mở một cuộc trò chuyện LiveChat */
    body.mobile-chat-open #icFloatingBtn,
    body.mobile-chat-open .ic-floating-btn,
    body.has-active-chat #icFloatingBtn,
    body.has-active-chat .ic-floating-btn {
        display: none !important;
    }
}

/* Tự động ẩn nút Chat Nội Bộ khi đang mở giao diện hội thoại LiveChat (tránh che nút gửi tin nhắn) */
body.mobile-chat-open #icFloatingBtn,
body.mobile-chat-open .ic-floating-btn,
body.has-active-chat #icFloatingBtn,
body.has-active-chat .ic-floating-btn {
    display: none !important;
}
