/* Modern WebSocket Chat Styles with Dark/Light/System Theme Support */

:root {
    /* Light theme variables */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --surface-color: #ffffff;
    --background-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --sidebar-bg: #f1f5f9;
    --header-bg: #ffffff;
    --message-bg: #f8fafc;
    --own-message-bg: var(--primary-color);
    --scrollbar-track: transparent;
    --scrollbar-thumb: #9ca3af;
    --scrollbar-thumb-hover: #6b7280;
    --modal-backdrop: rgba(0, 0, 0, 0.5);
    --shadow-color: rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -2px var(--shadow-color);
    --shadow-lg: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -4px var(--shadow-color);
}

[data-theme="dark"] {
    /* Dark theme variables - REALLY dark as requested */
    --primary-color: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary-color: #9ca3af;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --surface-color: #0a0a0a;
    --background-color: #000000;
    --border-color: #262626;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --sidebar-bg: #0f0f0f;
    --header-bg: #0a0a0a;
    --message-bg: #1a1a1a;
    --own-message-bg: var(--primary-color);
    --scrollbar-track: transparent;
    --scrollbar-thumb: #404040;
    --scrollbar-thumb-hover: #525252;
    --modal-backdrop: rgba(0, 0, 0, 0.8);
    --shadow-color: rgb(0 0 0 / 0.3);
}

/* Auto-detect system preference when theme is set to system */
@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        --primary-color: #60a5fa;
        --primary-dark: #3b82f6;
        --secondary-color: #9ca3af;
        --success-color: #34d399;
        --warning-color: #fbbf24;
        --danger-color: #f87171;
        --surface-color: #0a0a0a;
        --background-color: #000000;
        --border-color: #262626;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --sidebar-bg: #0f0f0f;
        --header-bg: #0a0a0a;
        --message-bg: #1a1a1a;
        --own-message-bg: var(--primary-color);
        --scrollbar-track: transparent;
        --scrollbar-thumb: #404040;
        --scrollbar-thumb-hover: #525252;
        --modal-backdrop: rgba(0, 0, 0, 0.8);
        --shadow-color: rgb(0 0 0 / 0.3);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.hidden {
    display: none !important;
}

/* App Container */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.app-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.header-left i {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.connection-indicator.connected {
    background-color: #d1fae5;
    color: #065f46;
}

[data-theme="dark"] .connection-indicator.connected {
    background-color: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.connection-indicator.connecting {
    background-color: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .connection-indicator.connecting {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.connection-indicator.disconnected {
    background-color: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .connection-indicator.disconnected {
    background-color: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.connection-indicator i {
    font-size: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
}

.icon-button {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background-color: var(--message-bg);
    color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--message-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.theme-toggle:hover {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Authentication Overlay */
.auth-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

[data-theme="dark"] .auth-overlay {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.auth-container {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 24rem;
    box-shadow: var(--shadow-lg);
    transition: background-color 0.3s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    z-index: 1;
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--surface-color);
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

[data-theme="dark"] .input-group input:focus {
    box-shadow: 0 0 0 3px rgb(96 165 250 / 0.1);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.primary-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.primary-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.secondary-button {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-button:hover {
    background: var(--message-bg);
}

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.google-button:hover {
    background: var(--message-bg);
}

.google-button img {
    width: 1.25rem;
    height: 1.25rem;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    inset: 0;
    top: 50%;
    height: 1px;
    background: var(--border-color);
    transition: background-color 0.3s ease;
}

.auth-divider span {
    background: var(--surface-color);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.token-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Chat Interface */
.chat-interface {
    height: 100%;
    display: flex;
    overflow: hidden;
}

.chat-sidebar {
    width: 20rem;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s ease;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.conversation-item.active {
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.conversation-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.conversation-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.conversation-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.unread-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    min-width: 1.25rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

.section-header {
    padding: 0.75rem 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.full-width {
    width: 100%;
}

/* Chat Main Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface-color);
    transition: background-color 0.3s ease;
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.chat-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.chat-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.connection-label {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.domain-name {
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.messages-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message Styles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: messageSlideIn 0.3s ease-out;
}

.message.own {
    align-self: flex-end;
    align-items: flex-end;
}

.message.other {
    align-self: flex-start;
    align-items: flex-start;
}

.message.system {
    align-self: center;
    align-items: center;
    max-width: 80%;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.message-sender {
    font-weight: 500;
}

.message-time {
    opacity: 0.7;
}

.message-room-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.125rem 0.375rem;
    border-radius: 0.75rem;
    font-size: 0.625rem;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .message-room-tag {
    background: rgba(96, 165, 250, 0.2);
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.message.own .message-bubble {
    background: var(--own-message-bg);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.message.other .message-bubble {
    background: var(--message-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-sm);
}

.message.system .message-bubble {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    border-radius: var(--radius-md);
}

[data-theme="dark"] .message.system .message-bubble {
    background: rgba(156, 163, 175, 0.1);
}

.message.error .message-bubble {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .message.error .message-bubble {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.message.private .message-room-tag {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

[data-theme="dark"] .message.private .message-room-tag {
    background: rgba(251, 191, 36, 0.2);
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
}

.message-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--message-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.message-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

[data-theme="dark"] .message-input-wrapper:focus-within {
    box-shadow: 0 0 0 3px rgb(96 165 250 / 0.1);
}

.message-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    line-height: 1.4;
    resize: none;
    max-height: 8rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.message-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.send-button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.private-indicator {
    background: rgba(245, 158, 11, 0.1);
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--warning-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .private-indicator {
    background: rgba(251, 191, 36, 0.1);
    border-top: 1px solid rgba(251, 191, 36, 0.2);
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: -24rem;
    width: 24rem;
    height: 100vh;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    z-index: 30;
    overflow-y: auto;
}

.settings-panel.show {
    right: 0;
}

.settings-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s ease;
}

.settings-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.settings-sections {
    flex: 1;
    padding: 1.5rem;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.setting-item small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.3s ease;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.theme-option {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--message-bg);
    cursor: pointer;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.theme-option:hover {
    border-color: var(--primary-color);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

[data-theme="dark"] .theme-option.active {
    background: rgba(96, 165, 250, 0.1);
}

.theme-option i {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.domain-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.domain-endpoint {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
    background: var(--message-bg);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.debug-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--message-bg);
    border-radius: var(--radius-md);
    transition: background-color 0.3s ease;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.debug-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.debug-log {
    background: #1f2937;
    color: #f9fafb;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.75rem;
    height: 12rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

[data-theme="dark"] .debug-log {
    background: #000000;
    border: 1px solid var(--border-color);
}

.log-entry {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.log-success { color: #34d399; }
.log-error { color: #f87171; }
.log-info { color: #60a5fa; }

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.warning-button {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.warning-button:hover {
    background: #d97706;
}

.danger-button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.danger-button:hover {
    background: #dc2626;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: var(--modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
    transition: background-color 0.3s ease;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
    transition: background-color 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s ease;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    transition: border-color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 100%;
        position: absolute;
        left: -100%;
        z-index: 20;
        transition: left 0.3s ease;
    }

    .chat-sidebar.show {
        left: 0;
    }

    .header-left h1 {
        font-size: 1.125rem;
    }

    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .modal-content {
        margin: 1rem;
        max-width: none;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .input-area {
        padding: 0.75rem 1rem;
    }

    .messages-list {
        padding: 0.75rem;
    }
}

/* Scrollbar Styling */
.messages-list::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar,
.debug-log::-webkit-scrollbar {
    width: 0.375rem;
}

.messages-list::-webkit-scrollbar-track,
.conversation-list::-webkit-scrollbar-track,
.debug-log::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.messages-list::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb,
.debug-log::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 0.25rem;
    transition: background-color 0.3s ease;
}

.messages-list::-webkit-scrollbar-thumb:hover,
.conversation-list::-webkit-scrollbar-thumb:hover,
.debug-log::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}