/* MUchatEMG - Modern Web Application Styles */

:root {
    /* Color palette - Dark theme (default) */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-hover: #2a2a2a;
    --bg-active: #333333;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #6b6b6b;
    --text-muted: #4a4a4a;
    
    --accent-primary: #10b981;
    --accent-secondary: #059669;
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --border-color: #2a2a2a;
    --border-light: #333333;
    
    --user-message-bg: #10b981;
    --user-message-text: #ffffff;
    --assistant-message-bg: #1e1e1e;
    --assistant-message-text: #e5e5e5;
    
    --code-bg: #0d0d0d;
    --code-border: #333333;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    
    --sidebar-width: 280px;
    --header-height: 60px;
    --input-height: 80px;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #ebebeb;
    --bg-hover: #e5e5e5;
    --bg-active: #d9d9d9;
    
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-tertiary: #737373;
    --text-muted: #a3a3a3;
    
    --border-color: #e5e5e5;
    --border-light: #d4d4d4;
    
    --assistant-message-bg: #f5f5f5;
    --assistant-message-text: #171717;
    
    --code-bg: #f5f5f5;
    --code-border: #e5e5e5;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), width var(--transition-normal);
    z-index: 100;
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.new-chat-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.new-chat-btn svg {
    width: 18px;
    height: 18px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.status-indicator.loading {
    background: #f59e0b;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.stats {
    display: flex;
    gap: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title h1 {
    font-size: 1.125rem;
    font-weight: 600;
}

.badge {
    background: var(--accent-gradient);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Header link button with text */
.header-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-link-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-link-btn svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
    display: block;
}

/* Chat Area */
.chat-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    min-height: 100%;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: transparent;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.welcome-icon svg {
    width: 40px;
    height: 40px;
}

.welcome-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.welcome-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content > p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-fast);
}

.feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.feature-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.suggestions-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.suggestion-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.suggestion-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.suggestion-category {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.suggestion-question {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Messages Container */
.messages-container {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.messages-container.hidden {
    display: none;
}

/* Message */
.message {
    margin-bottom: 24px;
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.message.user .message-avatar {
    background: var(--accent-gradient);
    color: white;
}

.message.assistant .message-avatar {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    overflow: hidden;
}

.avatar-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.message-author {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.message-content {
    padding-left: 44px;
}

.message.user .message-content {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-left: 44px;
    padding-left: 16px;
}

.message.assistant .message-content {
    line-height: 1.7;
}

/* Markdown styling in messages */
.message-content h1, .message-content h2, .message-content h3, 
.message-content h4, .message-content h5, .message-content h6 {
    margin: 1.5em 0 0.75em;
    font-weight: 600;
    line-height: 1.3;
}

.message-content h1 { font-size: 1.5rem; }
.message-content h2 { font-size: 1.25rem; }
.message-content h3 { font-size: 1.1rem; }

.message-content p {
    margin-bottom: 1em;
}

.message-content ul, .message-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.message-content li {
    margin-bottom: 0.5em;
}

.message-content code {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.message-content pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow-x: auto;
    margin: 1em 0;
}

.message-content pre code {
    background: none;
    border: none;
    padding: 0;
}

.message-content blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 16px;
    margin: 1em 0;
    color: var(--text-secondary);
}

.message-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5em 0;
}

.message-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-content em {
    color: var(--text-secondary);
}

/* Message metadata */
.message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item svg {
    width: 14px;
    height: 14px;
}

.meta-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-primary);
    opacity: 0.7;
    transition: opacity var(--transition-fast);
    margin-left: 4px;
}

.meta-link:hover {
    opacity: 1;
}

.meta-link svg {
    width: 14px;
    height: 14px;
}

.confidence-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.confidence-fill.low { background: #ef4444; }
.confidence-fill.medium { background: #f59e0b; }
.confidence-fill.high { background: var(--accent-primary); }

/* Loading indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-secondary);
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Progress Loading Indicator */
.loading-progress {
    padding: 20px 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin: 8px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.progress-time {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 12px;
}

.progress-bar-container {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    opacity: 0.4;
    transition: all var(--transition-fast);
}

.progress-step.active {
    opacity: 1;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
    border-left: 3px solid var(--accent-primary);
}

.progress-step.completed {
    opacity: 0.7;
}

.step-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.step-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-step.active .step-name {
    color: var(--text-primary);
    font-weight: 500;
}

.progress-step.completed .step-name {
    color: var(--text-tertiary);
}

.step-status {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.progress-step.active .step-spinner {
    display: block;
}

.step-check {
    color: var(--accent-primary);
    font-weight: bold;
    font-size: 0.9rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments for progress */
@media (max-width: 768px) {
    .loading-progress {
        padding: 16px;
    }
    
    .progress-step {
        padding: 8px 12px;
    }
    
    .step-name {
        font-size: 0.8rem;
    }
}

/* Input Area */
.input-area {
    padding: 16px 20px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-wrapper textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.5;
}

.input-wrapper textarea::placeholder {
    color: var(--text-tertiary);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.verify-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    user-select: none;
}

.verify-toggle input {
    accent-color: var(--accent-primary);
}

.verify-toggle:hover {
    color: var(--text-secondary);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

.input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn var(--transition-normal);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.setting-group input[type="range"] {
    flex: 1;
    margin: 0 12px;
    accent-color: var(--accent-primary);
}

.setting-group input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
    
    .message-content {
        padding-left: 0;
    }
    
    .message.user .message-content {
        margin-left: 0;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
}

/* Error message styling */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    color: #ef4444;
}

/* Verification badge */
.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.verification-badge.accept {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
}

.verification-badge.revise {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.verification-badge.reject {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* References section styling */
.references-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.references-section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
}

/* Data Tables - Beautiful styling */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5em 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.5;
}

.data-table thead {
    background: var(--accent-gradient);
    color: white;
}

.data-table th {
    padding: 12px 16px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--accent-secondary);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 10px 16px;
    vertical-align: top;
}

/* Alternating row colors */
.data-table tbody tr:nth-child(even) {
    background: var(--bg-tertiary);
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--bg-hover);
}

/* Compact table variant */
.data-table.compact th,
.data-table.compact td {
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* Light theme adjustments */
[data-theme="light"] .data-table thead {
    background: var(--accent-gradient);
}

[data-theme="light"] .data-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.08);
}

/* Table cell content styling */
.data-table td code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
}

/* Responsive table on small screens */
@media (max-width: 768px) {
    .table-wrapper {
        margin: 1em -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Streaming Response Styles */
.streaming-container {
    min-height: 40px;
}

.streaming-progress {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 8px;
}

.streaming-progress .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.streaming-progress .progress-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.streaming-progress .progress-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.streaming-progress .progress-bar-container {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.streaming-progress .progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.streaming-progress .progress-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.streaming-progress .progress-status .step-icon {
    font-size: 1em;
}

.streaming-progress .progress-status .step-name {
    flex: 1;
}

.streaming-progress .progress-status .step-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.streaming-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.streaming-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.streaming-step .step-icon {
    font-size: 1.1em;
}

.streaming-step .step-name {
    flex: 1;
    color: var(--text-secondary);
}

.streaming-step.active .step-name {
    color: var(--text-primary);
}

.streaming-step .step-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.streaming-content {
    line-height: 1.7;
}

.streaming-text {
    display: inline;
}

.streaming-cursor {
    display: inline-block;
    color: var(--accent-primary);
    animation: blink 0.8s step-end infinite;
    margin-left: 2px;
    font-weight: normal;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
