/**
 * Live Chat Widget - Team Exciting Premium
 * Real-time chat with WebSocket integration
 * Version: 1.0.0
 */

/* ============================================
   CHAT TOGGLE BUTTON
   ============================================ */

.te-chat-toggle {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
    transition: var(--transition-all);
    z-index: var(--z-fixed);
    outline: none;
}

.te-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl), var(--shadow-glow-primary-md);
}

.te-chat-toggle:active {
    transform: scale(0.95);
}

.te-chat-toggle svg {
    width: 28px;
    height: 28px;
    fill: #000;
    transition: var(--transition-all);
}

.te-chat-toggle.open svg {
    transform: rotate(90deg);
}

/* Notification Badge */
.te-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-error);
    color: #fff;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    animation: te-badge-pulse 2s infinite;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-all);
}

.te-chat-badge.visible {
    opacity: 1;
    visibility: visible;
}

@keyframes te-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}


/* ============================================
   CHAT WINDOW
   ============================================ */

.te-chat-window {
    position: fixed;
    bottom: calc(var(--space-6) + 70px);
    right: var(--space-6);
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--color-bg-medium);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--z-modal);

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition-all);
}

.te-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}


/* ============================================
   CHAT HEADER
   ============================================ */

.te-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-bg-medium) 100%);
    border-bottom: 1px solid var(--color-border-subtle);
}

.te-chat-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.te-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.te-chat-title {
    display: flex;
    flex-direction: column;
}

.te-chat-title-text {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-heading);
    line-height: var(--leading-tight);
}

.te-chat-status {
    display: flex;
    align-items: center;
    gap: var(--space-1-5);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.te-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-success);
    animation: te-status-pulse 2s infinite;
}

@keyframes te-status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.te-chat-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-base);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: var(--transition-all);
}

.te-chat-close:hover {
    background: var(--color-bg-lighter);
    color: var(--color-text-primary);
}

.te-chat-close svg {
    width: 20px;
    height: 20px;
}


/* ============================================
   ONLINE USERS BAR
   ============================================ */

.te-chat-online-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    background: var(--color-bg-dark);
    border-bottom: 1px solid var(--color-border-subtle);
    overflow-x: auto;
}

.te-chat-online-bar::-webkit-scrollbar {
    height: 4px;
}

.te-chat-online-bar::-webkit-scrollbar-track {
    background: var(--color-bg-darker);
}

.te-chat-online-bar::-webkit-scrollbar-thumb {
    background: var(--color-border-medium);
    border-radius: var(--radius-full);
}

.te-chat-online-user {
    position: relative;
    flex-shrink: 0;
}

.te-chat-online-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg-medium);
    object-fit: cover;
}

.te-chat-online-user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-success);
    border: 2px solid var(--color-bg-dark);
}

.te-chat-online-count {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    padding-left: var(--space-2);
}


/* ============================================
   MESSAGES AREA
   ============================================ */

.te-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--color-bg-dark);
}

.te-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.te-chat-messages::-webkit-scrollbar-track {
    background: var(--color-bg-darker);
}

.te-chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-border-medium);
    border-radius: var(--radius-full);
}

.te-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-strong);
}


/* ============================================
   MESSAGE BUBBLE
   ============================================ */

.te-chat-message {
    display: flex;
    gap: var(--space-2);
    max-width: 85%;
    animation: te-message-slide-in 0.3s var(--ease-out);
}

@keyframes te-message-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.te-chat-message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.te-chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    object-fit: cover;
}

.te-chat-message-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.te-chat-message-bubble {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-bg-medium);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    word-wrap: break-word;
}

.te-chat-message.own .te-chat-message-bubble {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-color: transparent;
    color: #000;
}

/* Moderated message indicator */
.te-chat-message.moderated .te-chat-message-bubble::after {
    content: '🔇';
    margin-left: var(--space-2);
    font-size: var(--text-xs);
    opacity: 0.7;
}

.te-chat-message.moderated .te-chat-message-content::before {
    content: 'Message filtered';
    display: block;
    font-size: 10px;
    color: var(--color-warning);
    margin-bottom: var(--space-1);
    opacity: 0.8;
}

.te-chat-message-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-1);
}

.te-chat-message-name {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
}

.te-chat-message.own .te-chat-message-name {
    display: none;
}

.te-chat-message-time {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}


/* ============================================
   TYPING INDICATOR
   ============================================ */

.te-chat-typing {
    display: none;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.te-chat-typing.visible {
    display: flex;
}

.te-chat-typing-dots {
    display: flex;
    gap: 4px;
}

.te-chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-text-muted);
    animation: te-typing-bounce 1.4s infinite ease-in-out;
}

.te-chat-typing-dot:nth-child(1) { animation-delay: 0s; }
.te-chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.te-chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes te-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}


/* ============================================
   INPUT AREA
   ============================================ */

.te-chat-input-area {
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    background: var(--color-bg-medium);
    border-top: 1px solid var(--color-border-subtle);
}

.te-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
}

.te-chat-input-wrapper {
    flex: 1;
    position: relative;
}

.te-chat-input {
    width: 100%;
    min-height: 44px;
    max-height: 100px;
    padding: var(--space-3) var(--space-4);
    padding-right: 44px;
    background: var(--color-bg-dark);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    resize: none;
    outline: none;
    transition: var(--transition-all);
}

.te-chat-input::placeholder {
    color: var(--color-text-muted);
}

.te-chat-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.te-chat-emoji-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-base);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--color-text-muted);
    transition: var(--transition-all);
}

.te-chat-emoji-btn:hover {
    background: var(--color-bg-lighter);
    color: var(--color-text-primary);
}

.te-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-all);
    flex-shrink: 0;
}

.te-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow-primary);
}

.te-chat-send-btn:active {
    transform: scale(0.95);
}

.te-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.te-chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: #000;
}


/* ============================================
   EMOJI PICKER
   ============================================ */

.te-chat-emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: var(--space-2);
    padding: var(--space-3);
    background: var(--color-bg-medium);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space-1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-all);
    z-index: var(--z-popover);
}

.te-chat-emoji-picker.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.te-chat-emoji {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-base);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.te-chat-emoji:hover {
    background: var(--color-bg-lighter);
    transform: scale(1.2);
}


/* ============================================
   SYSTEM MESSAGES
   ============================================ */

.te-chat-system-message {
    text-align: center;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-style: italic;
}

.te-chat-date-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
}

.te-chat-date-divider::before,
.te-chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border-subtle);
}

.te-chat-date-divider span {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}


/* ============================================
   WELCOME MESSAGE
   ============================================ */

.te-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8);
    height: 100%;
}

.te-chat-welcome-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
}

.te-chat-welcome-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-text-heading);
    margin-bottom: var(--space-2);
}

.te-chat-welcome-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 280px;
}


/* ============================================
   CONNECTION STATUS
   ============================================ */

.te-chat-connection {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--color-warning);
    color: #000;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.te-chat-connection.visible {
    display: flex;
}

.te-chat-connection.error {
    background: var(--color-error);
    color: #fff;
}

.te-chat-connection-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: var(--radius-full);
    animation: te-spin 1s linear infinite;
}

@keyframes te-spin {
    to { transform: rotate(360deg); }
}


/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .te-chat-toggle {
        bottom: var(--space-4);
        right: var(--space-4);
        width: 56px;
        height: 56px;
    }

    .te-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .te-chat-window.open {
        transform: translateY(0);
    }

    .te-chat-toggle.open {
        display: none;
    }
}


/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */

[data-theme="light"] .te-chat-toggle svg {
    fill: #fff;
}

[data-theme="light"] .te-chat-message.own .te-chat-message-bubble {
    color: #fff;
}

[data-theme="light"] .te-chat-send-btn svg {
    fill: #fff;
}


/* ============================================
   CHAT TABS (Global / Direct Messages)
   ============================================ */

.te-chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-bg-medium);
}

.te-chat-tab {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.te-chat-tab:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-light);
}

.te-chat-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.te-chat-tab-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--color-error);
    color: #fff;
    font-size: 10px;
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.te-chat-tab-badge:empty {
    display: none;
}


/* ============================================
   CHAT VIEWS (Content Panels)
   ============================================ */

.te-chat-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.te-chat-view.active {
    display: flex;
}


/* ============================================
   CONVERSATIONS LIST (DM Overview)
   ============================================ */

.te-chat-conversations {
    flex: 1;
    overflow-y: auto;
    background: var(--color-bg-dark);
}

.te-chat-conversation-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
    cursor: pointer;
    transition: var(--transition-all);
}

.te-chat-conversation-item:hover {
    background: var(--color-bg-light);
}

.te-chat-conversation-item.unread {
    background: rgba(var(--color-primary-rgb), 0.1);
}

.te-chat-conversation-item.active {
    background: var(--color-bg-lighter);
    border-left: 3px solid var(--color-primary);
}

.te-chat-conversation-avatar {
    position: relative;
    flex-shrink: 0;
}

.te-chat-conversation-avatar img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.te-chat-conversation-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--color-success);
    border: 2px solid var(--color-bg-dark);
}

.te-chat-conversation-online.offline {
    background: var(--color-text-muted);
}

.te-chat-conversation-info {
    flex: 1;
    min-width: 0;
}

.te-chat-conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-1);
}

.te-chat-conversation-name {
    font-weight: var(--font-semibold);
    color: var(--color-text-heading);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.te-chat-conversation-item.unread .te-chat-conversation-name {
    color: var(--color-primary);
}

.te-chat-conversation-time {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.te-chat-conversation-preview {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.te-chat-conversation-item.unread .te-chat-conversation-preview {
    color: var(--color-text-secondary);
    font-weight: var(--font-medium);
}

.te-chat-conversation-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #000;
    font-size: 11px;
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


/* ============================================
   DM CHAT VIEW (Individual Conversation)
   ============================================ */

.te-chat-dm-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.te-chat-dm-view.active {
    display: flex;
}

.te-chat-dm-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-medium);
    border-bottom: 1px solid var(--color-border-subtle);
}

.te-chat-dm-back {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-base);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: var(--transition-all);
}

.te-chat-dm-back:hover {
    background: var(--color-bg-lighter);
    color: var(--color-text-primary);
}

.te-chat-dm-back svg {
    width: 18px;
    height: 18px;
}

.te-chat-dm-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
}

.te-chat-dm-user-avatar {
    position: relative;
}

.te-chat-dm-user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.te-chat-dm-user-online {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-success);
    border: 2px solid var(--color-bg-medium);
}

.te-chat-dm-user-info {
    flex: 1;
}

.te-chat-dm-user-name {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text-heading);
}

.te-chat-dm-user-status {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.te-chat-dm-actions {
    display: flex;
    gap: var(--space-2);
}

.te-chat-dm-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-base);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: var(--transition-all);
}

.te-chat-dm-action:hover {
    background: var(--color-bg-lighter);
    color: var(--color-text-primary);
}

.te-chat-dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--color-bg-dark);
}


/* ============================================
   USER SEARCH / NEW DM
   ============================================ */

.te-chat-search-container {
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-medium);
    border-bottom: 1px solid var(--color-border-subtle);
}

.te-chat-search-input {
    width: 100%;
    padding: var(--space-2-5) var(--space-4);
    padding-left: 36px;
    background: var(--color-bg-dark);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    outline: none;
    transition: var(--transition-all);
}

.te-chat-search-input::placeholder {
    color: var(--color-text-muted);
}

.te-chat-search-input:focus {
    border-color: var(--color-primary);
}

.te-chat-search-wrapper {
    position: relative;
}

.te-chat-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.te-chat-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--space-2);
    background: var(--color-bg-medium);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 240px;
    overflow-y: auto;
    z-index: var(--z-popover);
    display: none;
}

.te-chat-search-results.open {
    display: block;
}

.te-chat-search-result {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: var(--transition-all);
}

.te-chat-search-result:hover {
    background: var(--color-bg-light);
}

.te-chat-search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.te-chat-search-result-name {
    font-weight: var(--font-medium);
    color: var(--color-text-heading);
}

.te-chat-search-result-meta {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.te-chat-search-empty {
    padding: var(--space-6);
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}


/* ============================================
   EMPTY STATES
   ============================================ */

.te-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    text-align: center;
    flex: 1;
}

.te-chat-empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.te-chat-empty-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-heading);
    margin-bottom: var(--space-2);
}

.te-chat-empty-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 250px;
}

.te-chat-empty-action {
    margin-top: var(--space-4);
    padding: var(--space-2-5) var(--space-5);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-base);
    color: #000;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: var(--transition-all);
}

.te-chat-empty-action:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow-primary);
}


/* ============================================
   CLICKABLE ONLINE USER (Start DM)
   ============================================ */

.te-chat-online-user {
    cursor: pointer;
    transition: var(--transition-all);
}

.te-chat-online-user:hover {
    transform: scale(1.1);
}

.te-chat-online-user:hover .te-chat-online-user-avatar {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow-primary);
}


/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .te-chat-window,
    .te-chat-message,
    .te-chat-emoji-picker,
    .te-chat-toggle {
        transition: none;
    }

    .te-chat-badge,
    .te-chat-status-dot,
    .te-chat-typing-dot {
        animation: none;
    }
}
