/* =================================================================
   🕵️ ANONYMOUS CHAT MODE - DARK THEME + USER LIST
   ================================================================= */

/* Header controls layout */
.ai-chatbot-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toggle Buttons */
.ai-chatbot-mode-toggle,
.ai-chatbot-users-toggle {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--cp-red);
    color: var(--cp-red);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    /* Slight rounded for controls */
}

.ai-chatbot-mode-toggle:hover,
.ai-chatbot-users-toggle:hover {
    background: var(--cp-red);
    color: #000;
    box-shadow: 0 0 10px var(--cp-red);
}

/* User List Panel (New Feature) */
.ai-chatbot-user-list-panel {
    position: absolute;
    top: 60px;
    /* Below header */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    /* Fill rest of window */
    background: rgba(5, 5, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-top: 1px solid var(--cp-red);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chatbot-user-list-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.ai-chatbot-user-list-header {
    font-family: var(--cp-font);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chatbot-user-list-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* User Item Item */
.ai-chatbot-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: all 0.2s;
}

.ai-chatbot-user-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-chatbot-user-item.is-me {
    border-color: rgba(0, 255, 65, 0.5);
    background: rgba(0, 255, 65, 0.05);
}

.ai-chatbot-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    /* Chuyển thành icon vuông */
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid #444;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    text-shadow: 0 0 5px currentColor;
    /* Thêm hiệu ứng phát sáng cho emoji */
}

.ai-chatbot-user-item:hover .ai-chatbot-user-avatar {
    transform: scale(1.05);
    border-color: currentColor;
    box-shadow: 0 0 15px currentColor;
    /* Phát sáng theo màu khi hover */
}

.ai-chatbot-user-info {
    flex: 1;
}

.ai-chatbot-user-name {
    font-family: var(--cp-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ai-chatbot-user-status {
    font-size: 11px;
    color: #888;
}

/* Mode Info Bar */
.ai-chatbot-mode-info {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: rgba(100, 100, 255, 0.05);
    border-bottom: 1px solid rgba(100, 100, 255, 0.2);
    font-family: var(--cp-font);
    font-size: 12px;
}

.ai-chatbot-mode-badge {
    color: #6464ff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-chatbot-user-count {
    color: #888;
    cursor: pointer;
}

.ai-chatbot-user-count:hover {
    color: #fff;
    text-decoration: underline;
}

/* Sender name styling */
.ai-chatbot-sender-name {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-chatbot-system-message {
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

/* =================================================================
   ANONYMOUS MODE THEME COLORS (Overriding Red with Blue/Purple)
   ================================================================= */
.ai-chatbot-window.anonymous-mode {
    border-color: #6464ff;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(100, 100, 255, 0.2);
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-header {
    border-bottom-color: rgba(100, 100, 255, 0.3);
    background: rgba(100, 100, 255, 0.02);
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-header-title h3 {
    color: #6464ff;
    text-shadow: 0 0 5px rgba(100, 100, 255, 0.5);
}

/* Buttons in Anonymous Mode */
.ai-chatbot-window.anonymous-mode .ai-chatbot-mode-toggle,
.ai-chatbot-window.anonymous-mode .ai-chatbot-users-toggle,
.ai-chatbot-window.anonymous-mode .ai-chatbot-close-btn {
    border-color: #6464ff;
    color: #6464ff;
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-mode-toggle:hover,
.ai-chatbot-window.anonymous-mode .ai-chatbot-users-toggle:hover,
.ai-chatbot-window.anonymous-mode .ai-chatbot-close-btn:hover {
    background: #6464ff;
    color: #000;
    box-shadow: 0 0 10px #6464ff;
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-mode-info {
    display: flex;
}

/* Chat Messages Area */
.ai-chatbot-window.anonymous-mode .ai-chatbot-messages {
    background-color: #0a0a0f;
    background-image:
        linear-gradient(rgba(100, 100, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 100, 255, 0.05) 1px, transparent 1px);
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-message-avatar {
    width: 36px;
    height: 36px;
    border-width: 2px;
    border-style: solid;
    border-radius: 4px;
    /* Chuyển thành icon vuông */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    flex-shrink: 0;
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-message.bot .ai-chatbot-message-content {
    border-color: rgba(100, 100, 255, 0.3);
    background: rgba(100, 100, 255, 0.05);
}

/* User bubble in anonymous mode (me) */
.ai-chatbot-window.anonymous-mode .ai-chatbot-message.user .ai-chatbot-message-content {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

/* Input Area */
.ai-chatbot-window.anonymous-mode .ai-chatbot-input-area {
    border-top-color: #6464ff;
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-input-wrapper {
    border-color: rgba(100, 100, 255, 0.5);
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-input-wrapper::before,
.ai-chatbot-window.anonymous-mode .ai-chatbot-input-wrapper::after {
    border-color: #6464ff;
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-send-btn {
    background: rgba(100, 100, 255, 0.1);
    border-color: #6464ff;
    color: #6464ff;
}

.ai-chatbot-window.anonymous-mode .ai-chatbot-send-btn:hover:not(:disabled) {
    background: #6464ff;
    color: #000;
    box-shadow: 0 0 15px #6464ff;
}

/* Dark icon glow */
.ai-chatbot-button.anonymous-mode .ai-chatbot-icon-body {
    box-shadow: 0 0 25px rgba(100, 100, 255, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.8);
    animation: corePulseDark 2s infinite ease-in-out;
}

@keyframes corePulseDark {
    0% {
        box-shadow: 0 0 20px rgba(100, 100, 255, 0.6);
    }

    50% {
        box-shadow: 0 0 40px rgba(100, 100, 255, 0.9);
    }

    100% {
        box-shadow: 0 0 20px rgba(100, 100, 255, 0.6);
    }
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* 🔒 PRIVATE CHAT STYLES (NEW) */
/* ═══════════════════════════════════════════════════════════════════════ */

/* Private Chat Banner */
.ai-chatbot-private-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(255, 0, 255, 0.1);
    border-bottom: 1px solid rgba(255, 0, 255, 0.3);
    color: #ff00ff;
    font-size: 12px;
    font-weight: bold;
    animation: slideDown 0.3s ease-out;
}

.ai-chatbot-private-banner span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-chatbot-private-close {
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    border-radius: 50%;
    transition: background 0.2s;
}

.ai-chatbot-private-close:hover {
    background: rgba(255, 0, 255, 0.2);
}

/* User Item Active State */
.ai-chatbot-user-item {
    cursor: pointer;
}

.ai-chatbot-user-item.active {
    background: rgba(255, 0, 255, 0.15);
    border-color: #ff00ff;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.2);
}

/* Private Message Bubble */
.ai-chatbot-message.private .ai-chatbot-message-content {
    border-color: #ff00ff !important;
    background: rgba(255, 0, 255, 0.05) !important;
}

.ai-chatbot-message.private .ai-chatbot-message-avatar {
    border-color: #ff00ff !important;
    box-shadow: 0 0 5px #ff00ff !important;
}

.ai-chatbot-message.private .ai-chatbot-sender-name {
    color: #0400ff !important;
}

.private-label {
    font-size: 9px;
    background: #ff00ff;
    color: #000;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}