/* Nút N?i AI */
#ai-chat-toggle-btn {
    position: fixed;
    bottom: 45px;
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 114, 255, 0.4);
    z-index: 10001;
    transition: transform 0.3s ease;
}
#ai-chat-toggle-btn:hover {
    transform: scale(1.1);
}

/* Dot thông báo d?/xanh */
.ai-badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #00ff88;
    border: 2px solid #12141d;
    border-radius: 50%;
}

/* Khung Popup Chat */
#ai-chat-popup {
    position: fixed;
    bottom: 110px;
    right: 25px;
    width: 360px;
    height: 500px;
    background: var(--bg-panel) !important;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    z-index: 10001;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-popup-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

/* Header */
.ai-chat-header {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-header-info { display: flex; align-items: center; gap: 10px; }
.ai-avatar { font-size: 22px; }
.ai-title { margin: 0; font-size: 15px; color: #fff; font-weight: 600; }
.ai-status { font-size: 11px; color: #a0aec0; display: flex; align-items: center; gap: 4px; }
.status-dot { width: 6px; height: 6px; background: #00ff88; border-radius: 50%; }
.ai-close-btn { background: none; border: none; color: #a0aec0; font-size: 22px; cursor: pointer; }

/* Danh sách tin nh?n */
.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-line;
}
.ai-msg-bot {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.ai-msg-user {
    background: #0072ff;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Input */
.ai-chat-input-area {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
}
#ai-user-input {
    flex: 1;
    background: var(--bg-panel);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 13px;
    outline: none;
}
#ai-send-btn {
    background: #0072ff;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
