/* ===== JARVIS AI - PROFESSIONAL WORLD-CLASS INTERFACE ===== */
/* Designed for 30,000+ Students - College Submission Grade */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Professional Color System */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Neutral Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Dark Theme */
    --bg-primary: #0f1419;
    --bg-secondary: #16181d;
    --bg-tertiary: #1e2128;
    --bg-elevated: #252932;
    --bg-hover: #2a2f38;

    /* Text */
    --text-primary: #e7e9ea;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --text-inverse: #0f1419;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

    /* Effects */
    --blur-sm: 4px;
    --blur-md: 8px;
    --blur-lg: 16px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GLOBAL RESET ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

/* ===== HEADER NAVIGATION BUTTON STYLING ===== */
.header-btn {
    padding: 0.6rem 1.2rem !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 10px !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.header-btn:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    color: var(--text-primary) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

.header-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* ===== BACKEND STATUS INDICATOR ===== */
.backend-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0;
}

.backend-status.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.backend-status.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.backend-status.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.backend-status.checking {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.backend-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    margin-left: auto;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.sidebar-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* New Chat Button */
.new-chat-btn {
    margin: 12px;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.new-chat-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.new-chat-btn:active {
    transform: scale(0.98);
}

/* Chat History */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-history h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 12px 4px;
    margin-bottom: 4px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-tertiary);
}

.history-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.3;
    display: block;
}

.history-empty p {
    font-size: 13px;
    line-height: 1.5;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 13px;
    gap: 8px;
}

.history-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.history-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 500;
}

.chat-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-chat-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--error);
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
}

.history-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
}

.theme-selector-container {
    margin-bottom: 8px;
}

.theme-selector-container label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 6px;
}

.theme-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.theme-select:hover {
    border-color: var(--border-strong);
}

.theme-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sidebar-account-btn {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.sidebar-account-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

/* ===== HEADER ===== */
.header {
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-brain-icon {
    font-size: 20px;
    color: var(--primary-500);
}

.header h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.learning-platform-link,
.playground-link,
.project-gen-link,
.dashboard-link,
.ai-tools-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.learning-platform-link:hover,
.playground-link:hover,
.project-gen-link:hover,
.dashboard-link:hover,
.ai-tools-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.settings-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== MODE SELECTOR ===== */
.mode-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mode-tab:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--primary-600);
    color: white;
}

.mode-indicator {
    display: none;
}

/* ===== CHAT CONTAINER ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Welcome Screen */
.welcome-screen {
    max-width: 768px;
    margin: 0 auto;
    padding: 40px 24px;
    text-align: center;
}

.welcome-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    font-weight: 400;
}

/* JARVIS Orb - Minimal & Professional */
.jarvis-orb-3d {
    width: 120px;
    height: 120px;
    margin: 32px auto;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.jarvis-orb-3d:hover {
    transform: scale(1.05);
}

.orb-core-3d {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-inner {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.4);
    transition: box-shadow var(--transition-base);
}

.jarvis-orb-3d:hover .core-inner {
    box-shadow: 0 0 80px rgba(59, 130, 246, 0.6);
}

/* Hide old complex animations */
.orb-ring-outer,
.orb-ring-middle,
.orb-ring-inner,
.orb-hexagon,
.orb-particles,
.core-glow {
    display: none !important;
}

.voice-hint {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 16px;
}

.voice-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.mode-description {
    margin-bottom: 24px;
}

.mode-description p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* AI Tools Hub */
.ai-tools-hub {
    margin-top: 48px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.ai-tools-hub h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-base);
}

.tool-card:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tool-card.current {
    border-color: var(--primary-500);
    background: var(--bg-elevated);
}

.tool-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
}

.tool-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.tool-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.api-status {
    text-align: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 8px;
}

.status-text {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Example Prompts */
.example-prompts {
    margin-top: 40px;
}

.example-prompts h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.prompt-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-base);
}

.prompt-card:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-500);
    transform: translateY(-2px);
}

.prompt-card i {
    font-size: 24px;
    color: var(--primary-500);
}

.prompt-card span {
    font-size: 14px;
    font-weight: 500;
}

/* ===== MESSAGES AREA ===== */
.messages-area {
    max-width: 768px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    background: var(--bg-elevated);
}

.message.user .message-avatar {
    background: var(--primary-600);
    color: white;
}

.message.ai .message-avatar {
    background: var(--bg-elevated);
    color: var(--primary-500);
}

.message-content {
    flex: 1;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.message.user .message-content {
    background: var(--primary-600);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
}

.message.ai .message-content {
    padding: 4px 0;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ===== INPUT AREA ===== */
.input-area {
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.input-container {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    transition: var(--transition-fast);
}

.input-container:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.attach-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.attach-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 8px;
    min-height: 24px;
    max-height: 200px;
}

textarea::placeholder {
    color: var(--text-tertiary);
}

.mic-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.mic-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mic-btn.listening {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.send-btn {
    background: var(--primary-600);
    border: none;
    color: white;
    font-size: 18px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--primary-700);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    max-width: 768px;
    margin: 8px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 0 4px;
}

.char-count {
    font-family: 'JetBrains Mono', monospace;
}

/* ===== DEVELOPER CREDIT ===== */
.developer-credit {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
}

.developer-credit strong {
    color: var(--primary-500);
    font-weight: 600;
}

/* ===== SETTINGS MODAL ===== */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(var(--blur-sm));
    backdrop-filter: blur(var(--blur-sm));
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.settings-modal.show {
    display: flex;
}

.settings-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.settings-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-settings {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.close-settings:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-body {
    padding: 20px;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-selector {
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.voice-toggle-btn {
    padding: 6px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.voice-toggle-btn:hover {
    background: var(--bg-hover);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--success);
}

.status-indicator i {
    font-size: 8px;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100%;
        z-index: 1000;
        transition: left var(--transition-base);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: block;
    }

    .sidebar-close-btn {
        display: block;
    }

    .header-actions span {
        display: none;
    }

    .welcome-content h1 {
        font-size: 32px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .messages-area {
        padding: 16px;
    }
}

/* ===== MARKDOWN STYLES ===== */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.message-content h1 {
    font-size: 24px;
}

.message-content h2 {
    font-size: 20px;
}

.message-content h3 {
    font-size: 18px;
}

.message-content p {
    margin-bottom: 16px;
}

.message-content ul,
.message-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.message-content li {
    margin: 8px 0;
}

.message-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.message-content pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.message-content pre code {
    background: transparent;
    padding: 0;
    border: none;
}

.message-content a {
    color: var(--primary-500);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition-fast);
}

.message-content a:hover {
    border-bottom-color: var(--primary-500);
}

.message-content blockquote {
    border-left: 3px solid var(--primary-500);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.message-content th,
.message-content td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-subtle);
}

.message-content th {
    background: var(--bg-elevated);
    font-weight: 600;
}