/* ===== 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;

    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-elevated: #ffffff;
    --bg-hover: #f1f3f5;

    /* Text */
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #6c757d;
    --text-inverse: #ffffff;

    /* Borders */
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-default: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.24);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2);

    /* 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);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-elevated: #ffffff;
    --bg-hover: #f1f3f5;

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #6c757d;
    --text-inverse: #ffffff;

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-default: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.24);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* ===== CHATGPT PRO THEME ===== */
[data-theme="chatgpt-pro"] {
    --bg-primary: #343541;
    --bg-secondary: #202123;
    --bg-tertiary: #2a2b32;
    --bg-elevated: #3e3f4b;
    --bg-hover: #40414f;

    --text-primary: #ececf1;
    --text-secondary: #c5c5d2;
    --text-tertiary: #8e8ea0;
    --text-inverse: #202123;

    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);

    --primary-500: #19c37d;
    --primary-600: #17b373;
    --primary-700: #159f69;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
}

/* ===== 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;
    /* Prevent text size adjustment on orientation change */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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;
    /* Better tap highlighting on mobile */
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    /* Smooth and fast scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* GPU acceleration for better performance */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    /* Smooth scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

/* ===== 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: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    position: relative;
    animation: themePulse 3s ease-in-out infinite;
}

@keyframes themePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
    }
}

.theme-selector-container::before {
    content: '✨ RECOMMENDED';
    position: absolute;
    top: -8px;
    right: 8px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.theme-selector-container label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.theme-selector-container label i {
    font-size: 14px;
}

.theme-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 2px solid var(--primary-500);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.theme-select:hover {
    border-color: var(--primary-400);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.theme-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.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;
}

.brain-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brain-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.1);
}

.brain-btn:active {
    transform: scale(0.95);
}

.brain-btn.active {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.2);
}

.brain-btn.active .header-brain-icon {
    animation: brainActivate 0.3s ease;
}

@keyframes brainActivate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        color: #00ff88;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes inputPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.header-brain-icon {
    font-size: 24px;
    color: var(--primary-500);
    animation: pulse-brain 2s ease-in-out infinite;
}

@keyframes pulse-brain {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.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;
}

.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;
}

.learning-platform-link,
.playground-link,
.project-gen-link,
.dashboard-link,
.ai-tools-link,
.header-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.learning-platform-link:hover,
.playground-link:hover,
.project-gen-link:hover,
.dashboard-link:hover,
.ai-tools-link:hover,
.header-link:hover {
    background: var(--primary-500);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border-color: var(--primary-600);
}

.header-link i {
    font-size: 16px;
}

.header-link span {
    font-weight: 600;
}

.settings-btn,
.voice-btn {
    width: 42px;
    height: 42px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover,
.voice-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.voice-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* ===== 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;
    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;
    /* Performance optimizations for smooth scrolling */
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: scroll-position;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.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-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.message-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    max-width: 70%;
}

.message.ai .message-content {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    max-width: 85%;
}

/* 🧠 JARVIS 5.2 Typing/Thinking Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.thinking-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-400);
    animation: thinkingPulse 2s ease-in-out infinite;
}

@keyframes thinkingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-500);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.32s;
}

.typing-dot:nth-child(4) {
    animation-delay: 0.48s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Message Wrapper */
.message-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    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);
}

/* ===== CLEAN FLAT INPUT CONTAINER ===== */
.input-container {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.input-container:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.05);
}

/* ===== GEMINI-STYLE MODEL DROPDOWN ===== */
.model-dropdown {
    position: relative;
    flex-shrink: 0;
}

.model-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.model-dropdown-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-500);
}

.model-dropdown-btn .model-icon {
    font-size: 16px;
}

.model-dropdown-btn .model-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-dropdown-btn i.fa-chevron-down {
    font-size: 10px;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
}

.model-dropdown.open .model-dropdown-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

.model-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 1000;
    overflow: hidden;
}

.model-dropdown.open .model-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.model-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.model-option:hover {
    background: var(--bg-hover);
}

.model-option.selected {
    background: rgba(59, 130, 246, 0.1);
}

.model-option .option-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.model-option .option-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-option .option-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.model-option .option-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

.model-option .fa-check {
    color: var(--primary-500);
    font-size: 14px;
    opacity: 0;
}

.model-option.selected .fa-check {
    opacity: 1;
}

/* ===== INPUT ICON BUTTONS (Gemini-style) ===== */
.input-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.input-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-500);
}

.input-icon-btn.mic-btn.listening {
    color: var(--error);
    animation: pulse 1s infinite;
}

.input-divider {
    width: 1px;
    height: 24px;
    background: var(--border-default);
    flex-shrink: 0;
}

/* ===== TEXTAREA (Gemini-style) ===== */
textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 8px 0;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.5;
}

textarea::placeholder {
    color: var(--text-tertiary);
}

/* ===== SEND BUTTON (Gemini-style) ===== */
.send-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-600);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--primary-500);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
}

/* ===== IMAGE PREVIEW (Gemini-style) ===== */
.image-preview-container {
    max-width: 768px;
    margin: 12px auto 0;
    padding: 8px;
}

.image-preview-wrapper {
    position: relative;
    display: inline-block;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 8px;
}

.image-preview-wrapper img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.remove-image-btn:hover {
    background: var(--error);
    transform: scale(1.1);
}

/* ===== INPUT FOOTER ===== */
.input-footer {
    max-width: 768px;
    margin: 8px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.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 {
    display: none !important;
}

.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;
    }
}

/* Theme Notification Popup */
.theme-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 320px;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.theme-notification-icon {
    font-size: 24px;
    animation: rotateIcon 2s ease-in-out infinite;
}

@keyframes rotateIcon {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(15deg);
    }
}

.theme-notification-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
}

.theme-notification-content p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.theme-notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all 0.2s;
}

.theme-notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    /* Performance optimizations */
    * {
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .theme-notification {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    /* Sidebar */
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        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.7);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-close-btn {
        display: flex;
    }

    /* Header */
    .header {
        padding: 12px 16px;
        gap: 12px;
    }

    .header-center {
        display: none;
    }

    /* Chat messages - better mobile interface */
    .message {
        padding: 12px 14px !important;
        margin-bottom: 12px !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    .message-content {
        max-width: 100% !important;
    }

    /* Input area - cleaner on mobile */
    .input-container {
        padding: 12px !important;
        gap: 8px !important;
    }

    #messageInput {
        font-size: 16px !important;
        /* Prevent zoom on iOS */
        padding: 12px 14px !important;
        min-height: 44px !important;
    }

    /* Send button - bigger touch target */
    #sendBtn {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
    }

    /* Hide all navigation buttons on mobile - keep only on home page */
    .header-actions {
        display: none !important;
    }

    /* Show only on index.html (home) */
    body.home-page .header-actions {
        display: flex !important;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.home-page .header-actions::-webkit-scrollbar {
        display: none;
    }

    body.home-page .header-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 13px !important;
        white-space: nowrap;
    }

    body.home-page .header-btn span {
        display: none;
    }

    .header-btn i {
        margin: 0;
    }

    .brain-btn {
        padding: 6px;
    }

    .settings-btn,
    .voice-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Mode Selector */
    .mode-selector {
        padding: 8px 12px;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mode-selector::-webkit-scrollbar {
        display: none;
    }

    .mode-tab {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Model Dropdown - Mobile */
    .model-dropdown-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .model-dropdown-btn .model-name {
        max-width: 70px;
    }

    .model-dropdown-menu {
        min-width: 200px;
    }

    .model-option {
        padding: 10px 14px;
    }

    /* Input container - Mobile */
    .input-container {
        padding: 8px 12px;
        gap: 6px;
    }

    .input-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .send-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .input-divider {
        height: 20px;
    }

    /* Welcome Screen */
    .welcome-screen {
        padding: 24px 16px;
    }

    .welcome-content h1 {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 15px;
    }

    .jarvis-orb-3d {
        width: 100px;
        height: 100px;
    }

    /* Example Prompts */
    .prompt-grid {
        grid-template-columns: 1fr;
    }

    .prompt-card {
        padding: 14px;
    }

    /* Tools Grid */
    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* Messages */
    .messages-area {
        padding: 12px;
        gap: 16px !important;
        /* Reduce gap between messages */
        /* Enhanced scrolling performance */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        overscroll-behavior-y: contain;
    }

    .message {
        padding: 12px;
        /* Reduce animations on mobile for better performance */
        animation: none !important;
    }

    .message-content {
        font-size: 14px;
        line-height: 1.6 !important;
    }

    .message-content img {
        border-radius: 8px;
    }

    /* Input Area */
    .input-area {
        padding: 12px;
        gap: 8px;
    }

    .input-wrapper {
        padding: 10px 12px;
    }

    .message-input {
        font-size: 15px;
        min-height: 40px;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Developer Credit */
    .developer-credit {
        font-size: 11px;
        padding: 8px;
    }

    /* Modals */
    .settings-modal-content {
        width: 95%;
        max-width: 400px;
        padding: 20px;
    }

    /* Voice Commit Modal */
    .voice-commit-container {
        width: 95%;
        max-width: 500px;
        padding: 24px 16px;
    }

    .focus-mode-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .focus-mode-btn {
        padding: 8px;
        font-size: 11px;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }

    .header-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 12px !important;
    }

    .welcome-content h1 {
        font-size: 24px;
    }

    .jarvis-orb-3d {
        width: 80px;
        height: 80px;
    }

    .message {
        padding: 10px;
    }

    .input-area {
        padding: 10px;
    }

    .message-input {
        font-size: 14px;
    }

    .focus-mode-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 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;
}

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}

/* ===== PROJECT GENERATOR STYLES ===== */
.project-generator-unique-content {
    padding: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.input-section {
    margin-bottom: 32px;
}

.input-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.input-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-card textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 20px;
    min-height: 100px;
    resize: vertical;
}

.input-card textarea:focus {
    border-color: var(--primary-500);
    outline: none;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.option-group select {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.features-section {
    margin-bottom: 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.feature-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.feature-checkbox:hover {
    background: var(--bg-elevated);
}

.feature-checkbox input {
    accent-color: var(--primary-500);
}

.generate-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Output Section */
.output-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    animation: fadeIn 0.5s ease-out;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.output-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.output-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 8px 16px;
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--primary-700);
}

.action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.action-btn.secondary:hover {
    background: var(--bg-elevated);
}

/* File Tree */
.structure-section {
    margin-bottom: 32px;
}

.structure-section h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.file-tree {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    overflow-x: auto;
}

/* File Blocks */
.file-block {
    margin-bottom: 24px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    overflow: hidden;
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-default);
}

.file-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-file-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-file-btn:hover {
    color: var(--primary-500);
}

.file-content {
    background: var(--bg-tertiary);
    padding: 16px;
    overflow-x: auto;
}

.file-content pre {
    margin: 0;
}

.file-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Instructions */
.instructions-content {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    line-height: 1.6;
}

.instructions-content pre {
    white-space: pre-wrap;
    font-family: inherit;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }

    .output-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .output-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        text-align: center;
    }
}

/* ===== LOAD MORE BUTTON (Pagination) ===== */
.load-more-btn {
    width: 100%;
    padding: 12px 20px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-tertiary));
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.load-more-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-500);
    color: var(--primary-400);
    transform: translateY(-1px);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn i {
    animation: bounceDown 1.5s infinite;
}

@keyframes bounceDown {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(3px);
    }
}

/* ===== 🧠 JARVIS 5.2 - SMART FOLLOW-UP SUGGESTIONS ===== */
.follow-up-container {
    padding: 16px 20px;
    margin: 8px 0 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    animation: slideIn 0.3s ease-out;
    transition: opacity 0.3s ease;
}

.follow-up-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-400);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.follow-up-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.follow-up-btn {
    padding: 10px 16px;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-up-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.follow-up-btn:active {
    transform: translateY(0);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* JARVIS 5.2 Badge */
.jarvis-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--primary-600), #8b5cf6);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Expert Mode Indicator */
.expert-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: var(--success);
    margin-left: 8px;
}

/* Mobile responsiveness for follow-ups */
@media (max-width: 768px) {
    .follow-up-container {
        padding: 12px 16px;
    }

    .follow-up-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .follow-up-buttons {
        flex-direction: column;
    }

    .follow-up-btn {
        width: 100%;
        text-align: center;
    }
}

/* Thinking Process UI */
.thinking-process {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    font-size: 13px;
    animation: fadeIn 0.5s ease-out;
}

.thinking-header {
    font-weight: 700;
    color: var(--primary-500);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.thinking-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.thinking-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
}

.thinking-steps li i {
    color: var(--success);
    font-size: 12px;
}

@keyframes slideIn {
    from {
        transform: translateX(-10px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.thinking-steps li:nth-child(1) {
    animation-delay: 0.1s;
}

.thinking-steps li:nth-child(2) {
    animation-delay: 0.3s;
}

.thinking-steps li:nth-child(3) {
    animation-delay: 0.5s;
}

.thinking-steps li:nth-child(4) {
    animation-delay: 0.7s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== KING MODE - SUPREME AUTHORITY THEME ===== */
.king-mode-aura {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
    z-index: -1;
}

.supreme-thinking {
    border: 2px solid var(--primary-500) !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2) !important;
    background: rgba(255, 215, 0, 0.05) !important;
}

.supreme-thinking .thinking-header {
    color: #FFD700 !important;
    font-size: 14px !important;
    letter-spacing: 0.1em !important;
}

/* Supernova Orb Animation */
@keyframes supernova {
    0% {
        transform: scale(1);
        box-shadow: 0 0 60px rgba(255, 215, 0, 0.4);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 0 120px rgba(255, 215, 0, 0.8), 0 0 200px rgba(255, 215, 0, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 60px rgba(255, 215, 0, 0.4);
    }
}

.orb-supernova {
    animation: supernova 2s ease-in-out infinite !important;
}

/* ===== MOBILE PREMIUM OPTIMIZATION (Smooth & User-Friendly) ===== */
@media (max-width: 768px) {

    /* 1. Global Smoothness */
    * {
        -webkit-tap-highlight-color: transparent;
        outline: none !important;
    }

    body {
        overscroll-behavior-y: none;
        /* Prevent pull-to-refresh bounce */
    }

    /* 2. Hardware Acceleration for Smoothness */
    .main-content,
    .sidebar,
    .chat-container,
    .jarvis-orb-3d {
        will-change: transform, opacity;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    /* 3. Premium Bottom Navigation */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(22, 24, 29, 0.85);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0 10px 15px;
        /* Extra bottom padding for home indicators */
        z-index: 1000;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-tertiary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        gap: 4px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: none;
        border: none;
        padding: 8px;
        flex: 1;
    }

    .nav-item i {
        font-size: 20px;
        transition: transform 0.3s ease;
    }

    .nav-item.active {
        color: var(--primary-400);
    }

    .nav-item.active i {
        transform: translateY(-5px);
        text-shadow: 0 0 15px var(--primary-500);
    }

    .nav-item:active {
        transform: scale(0.9);
        opacity: 0.7;
    }

    /* 4. Adjust Layout for Bottom Nav */
    .main-content {
        padding-bottom: 70px !important;
    }

    .input-area {
        bottom: 70px !important;
        /* Move input above bottom nav if fixed */
        background: rgba(15, 20, 25, 0.95) !important;
        backdrop-filter: blur(10px);
    }

    /* 5. Hide redundant header actions on mobile */
    body.home-page .header-actions {
        display: none !important;
    }

    /* 6. Smoother Sidebar Transition */
    .sidebar {
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    /* 7. Better Input Experience */
    .input-container {
        border-radius: 24px !important;
        padding: 8px 14px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    #messageInput {
        font-size: 16px !important;
        /* Prevents auto-zoom on iOS */
    }

    /* 8. Welcome Screen Polish */
    .welcome-screen {
        padding-top: 20px !important;
    }

    .welcome-content h1 {
        font-size: 24px !important;
        letter-spacing: 1px;
    }

    .jarvis-orb-3d {
        width: 90px !important;
        height: 90px !important;
        margin: 20px auto !important;
    }

    /* 9. Smooth Message Bubbles */
    .message {
        border-radius: 18px !important;
        margin-bottom: 10px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    /* 10. Floating Brain Button for Mobile */
    .brain-btn {
        background: linear-gradient(135deg, var(--primary-600), #8b5cf6) !important;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    }

    .header-brain-icon {
        color: white !important;
        font-size: 20px !important;
    }
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* ===== CLAUDE-INSPIRED MINIMALIST STYLE ===== */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.welcome-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    background: none;
    -webkit-text-fill-color: var(--text-primary);
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    opacity: 0.8;
}

/* Minimalist JARVIS Orb */
.jarvis-orb-minimal {
    width: 280px;
    height: 280px;
    position: relative;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-core {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, var(--primary-400), var(--primary-600));
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.5),
        inset 0 0 40px rgba(255, 255, 255, 0.2);
    animation: orbFloat 4s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.orb-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.8;
    margin: 0;
    padding: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 60px rgba(59, 130, 246, 0.5);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
        box-shadow: 0 0 80px rgba(59, 130, 246, 0.7);
    }
}

/* Action Chips */
.action-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 800px;
    margin-top: 2rem;
    padding: 20px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 16px;
}

.chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    border: 2px solid var(--primary-500);
    border-radius: 16px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chip:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    border-color: var(--primary-400);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.chip:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.chip i {
    font-size: 18px;
    color: white;
}

/* Redesigned Input Area (Claude Style) */
.input-area {
    padding: 20px 24px 40px;
    background: transparent !important;
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

.input-container {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: 24px !important;
    padding: 12px 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: var(--primary-500) !important;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15) !important;
}

#messageInput {
    font-size: 16px !important;
    line-height: 1.6 !important;
    padding: 8px 12px !important;
    color: var(--text-primary) !important;
}

.send-btn {
    background: var(--primary-600) !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

.send-btn:hover {
    background: var(--primary-500) !important;
    transform: scale(1.05);
}

/* Mobile Adjustments for Claude Style */
@media (max-width: 768px) {
    .welcome-screen {
        padding: 1rem;
        min-height: 50vh;
    }

    .action-chips {
        gap: 8px;
    }

    .chip {
        padding: 10px 16px;
        font-size: 13px;
    }

    .input-area {
        padding: 10px 16px 80px;
        /* Space for bottom nav */
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* JARVIS Orb States */
.jarvis-orb-3d.listening .core-inner { background: linear-gradient(135deg, #00ff88 0%, #00aa55 100%); box-shadow: 0 0 30px rgba(0, 255, 136, 0.6); animation: orbListening 1.5s ease-in-out infinite; }
.jarvis-orb-3d.thinking .core-inner { background: linear-gradient(135deg, #ffcc00 0%, #ff9900 100%); box-shadow: 0 0 30px rgba(255, 204, 0, 0.6); animation: orbThinking 1s linear infinite; }
.jarvis-orb-3d.speaking .core-inner { background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%); box-shadow: 0 0 40px rgba(0, 212, 255, 0.8); animation: orbSpeaking 0.5s ease-in-out infinite alternate; }
@keyframes orbListening { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.8; } }
@keyframes orbThinking { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes orbSpeaking { 0% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); } 100% { transform: scale(1.2); box-shadow: 0 0 50px rgba(0, 212, 255, 0.9); } }

/* Bottom Navigation (Mobile App Feel) */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; height: 70px; background: rgba(15, 20, 25, 0.95); backdrop-filter: blur(10px); display: none; justify-content: space-around; align-items: center; border-top: 1px solid rgba(255, 255, 255, 0.1); z-index: 1000; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav .nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-secondary); text-decoration: none; font-size: 11px; font-weight: 500; transition: all 0.3s ease; flex: 1; }
.bottom-nav .nav-item i { font-size: 20px; }
.bottom-nav .nav-item.active { color: #3b82f6; }
.bottom-nav .nav-item.active i { transform: translateY(-2px); text-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
/* COMPREHENSIVE MOBILE RESPONSIVE STYLES */
@media (max-width: 768px) { 
    /* Bottom Navigation */
    .bottom-nav { display: flex; } 
    .main-content { padding-bottom: 80px; } 
    .header-actions { display: none !important; } 
    .sidebar { display: none !important; } 
    .mobile-menu-btn { display: none; }
    
    /* Header */
    .jarvis-header { 
        padding: 1rem; 
        height: auto;
    }
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    .header-brand {
        font-size: 1.2rem;
    }
    
    /* Hero Sections */
    .hero {
        padding: 2rem 1rem !important;
        margin-top: 60px !important;
    }
    .hero h1 {
        font-size: 1.8rem !important;
    }
    .hero p {
        font-size: 1rem !important;
    }
    
    /* Containers */
    .container {
        padding: 1rem !important;
        max-width: 100% !important;
    }
    
    /* Grid Layouts */
    .stats-grid,
    .badges-grid,
    .courses-grid,
    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Cards with Mobile Touch Optimization */
    .stat-card,
    .course-card,
    .tool-card,
    .badge-item,
    .progress-item,
    .activity-item {
        padding: 1.25rem !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    /* Enhanced touch targets */
    .stat-card:active,
    .course-card:active,
    .tool-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    /* Buttons with better touch feedback */
    .header-link {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.95rem !important;
        min-height: 44px;
        min-width: 44px;
    }
    
    .reset-btn,
    .btn,
    .primary-btn {
        padding: 1rem 2rem !important;
        font-size: 1.05rem !important;
        min-height: 48px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .reset-btn:active,
    .btn:active,
    .primary-btn:active {
        transform: scale(0.95);
    }
    
    /* Chat Interface - Mobile Optimized */
    .chat-container {
        height: calc(100vh - 60px) !important;
        width: 100% !important;
        border-radius: 0 !important;
    }
    
    .messages-container {
        height: calc(100% - 140px) !important;
        padding: 1rem !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .message {
        max-width: 85% !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    .input-area {
        padding: 1rem !important;
        background: var(--bg-primary, #ffffff);
        border-top: 2px solid var(--border-color, #e9ecef);
    }
    
    #messageInput {
        font-size: 1.05rem !important;
        padding: 0.875rem !important;
        min-height: 44px;
    }
    
    /* Code Editor - Mobile Friendly */
    .editor-container {
        flex-direction: column !important;
        height: auto !important;
    }
    
    .file-explorer {
        width: 100% !important;
        max-height: 250px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .editor-main {
        width: 100% !important;
        height: 400px !important;
    }
    
    /* Course Generator */
    .generator-container {
        padding: 1rem !important;
    }
    
    .form-group {
        margin-bottom: 1.25rem !important;
    }
    
    input,
    textarea,
    select {
        font-size: 1.05rem !important;
        padding: 0.875rem !important;
        min-height: 44px;
    }
    
    /* JARVIS Orb - Mobile Optimized */
    .jarvis-orb-minimal,
    .jarvis-orb-3d {
        width: 220px !important;
        height: 220px !important;
        margin: 2rem auto !important;
    }
    
    .orb-text {
        font-size: 1.05rem !important;
        padding: 1rem !important;
    }
    
    /* Typography - Readable on Mobile */
    h1 { 
        font-size: 1.9rem !important; 
        line-height: 1.3 !important;
    }
    h2 { 
        font-size: 1.6rem !important; 
        line-height: 1.3 !important;
    }
    h3 { 
        font-size: 1.35rem !important; 
        line-height: 1.4 !important;
    }
    h4 { 
        font-size: 1.15rem !important; 
        line-height: 1.4 !important;
    }
    p, span, a, li { 
        font-size: 1rem !important; 
        line-height: 1.6 !important;
    }
    
    /* Spacing for better mobile UX */
    section {
        padding: 2.5rem 0 !important;
    }
    
    /* Tables - Mobile Scrollable */
    table {
        font-size: 0.9rem !important;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 1rem !important;
    }
    
    /* Action Chips - Touch Friendly */
    .chip,
    .action-chips button {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.95rem !important;
        min-height: 44px;
    }
    
    /* Modal - Full Screen on Mobile */
    .settings-modal-content,
    .voice-commit-container {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }
    
    /* Bottom Nav - Enhanced */
    .bottom-nav {
        height: 65px;
        padding: 0.5rem 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .bottom-nav .nav-item {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .bottom-nav .nav-item i {
        font-size: 22px;
    }
    
    /* Prevent text selection on interactive elements */
    button, a, .header-link, .chip {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Extra Small Devices - Phones in Portrait */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem !important;
    }
    
    .stat-card {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
    }
    
    .jarvis-orb-minimal,
    .jarvis-orb-3d {
        width: 180px !important;
        height: 180px !important;
    }
    
    .header-link {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .container {
        padding: 0.75rem !important;
    }
    
    /* Larger touch targets for small screens */
    button,
    a,
    input,
    select {
        min-height: 48px !important;
    }
    
    /* Optimize grid spacing */
    .stats-grid,
    .courses-grid,
    .tools-grid {
        gap: 0.75rem !important;
    }
}

/* Landscape Mode - Better Space Utilization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 1rem !important;
    }
    
    .chat-container {
        height: 100vh !important;
    }
    
    .jarvis-orb-minimal,
    .jarvis-orb-3d {
        width: 150px !important;
        height: 150px !important;
    }
    
    .stats-grid,
    .courses-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .header-link,
    .btn,
    button,
    a {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Remove hover effects */
    .stat-card:hover,
    .course-card:hover,
    .tool-card:hover,
    .header-link:hover {
        transform: none !important;
    }
    
    /* Add active states instead */
    .stat-card:active,
    .course-card:active,
    .tool-card:active {
        transform: scale(0.97) !important;
        opacity: 0.9 !important;
    }
    
    /* Better button feedback */
    button:active,
    .btn:active,
    .header-link:active {
        transform: scale(0.95) !important;
        opacity: 0.85 !important;
    }
}

/* High Resolution Mobile Displays */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    /* Sharper text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Optimize images */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ===== MOBILE APK SPECIFIC FIXES - 2026 ===== */
@media (max-width: 500px) {
    /* Fix status notification position */
    #backendStatus,
    #backend-status {
        top: 10px !important;
        padding: 8px 16px !important;
        font-size: 12px !important;
        border-radius: 20px !important;
        max-width: 90% !important;
    }
    
    /* Hide top header nav on mobile - use bottom nav instead */
    .header {
        display: none !important;
    }
    
    /* Mode selector at top */
    .mode-selector {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 100 !important;
        background: var(--bg-primary) !important;
        padding: 10px !important;
        border-bottom: 1px solid var(--border-default) !important;
    }
    
    /* Welcome screen fixes */
    .welcome-screen {
        padding: 60px 16px 200px !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    #welcomeTitle {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin-bottom: 10px !important;
        text-align: center !important;
    }
    
    /* JARVIS Orb - Mobile optimized - SHOW IT */
    .jarvis-orb-minimal {
        display: block !important;
        width: 100px !important;
        height: 100px !important;
        margin: 15px auto !important;
    }
    
    .jarvis-orb-minimal::before {
        width: 130px !important;
        height: 130px !important;
    }
    
    .jarvis-orb-minimal::after {
        width: 160px !important;
        height: 160px !important;
    }
    
    .orb-core {
        width: 100% !important;
        height: 100% !important;
    }
    
    .orb-text {
        font-size: 8px !important;
        letter-spacing: 0.5px !important;
    }
    
    /* Action chips */
    .action-chips {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        margin: 15px auto !important;
        padding: 0 10px !important;
    }
    
    .chip {
        padding: 10px 16px !important;
        font-size: 13px !important;
        border-radius: 20px !important;
        background: rgba(59, 130, 246, 0.1) !important;
        border: 1px solid rgba(59, 130, 246, 0.3) !important;
    }
    
    .chip i {
        font-size: 13px !important;
    }
    
    /* ===== CRITICAL: Input area fixes ===== */
    .input-area {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        padding: 10px 12px !important;
        background: var(--bg-primary) !important;
        border-top: 1px solid var(--border-default) !important;
        z-index: 100 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .input-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
        gap: 8px !important;
        background: var(--bg-secondary) !important;
        max-height: 60px !important;
    }
    
    /* Model dropdown smaller */
    .model-dropdown-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
        flex-shrink: 0 !important;
    }
    
    .model-dropdown-btn .model-name {
        max-width: 60px !important;
        font-size: 11px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .model-dropdown-btn .model-icon {
        font-size: 14px !important;
    }
    
    .model-dropdown-btn .fa-chevron-down {
        display: none !important;
    }
    
    /* Input icons */
    .input-icon-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
    }
    
    .input-divider {
        display: none !important;
    }
    
    /* ===== CRITICAL: Message input textarea ===== */
    #messageInput,
    textarea#messageInput {
        flex: 1 !important;
        font-size: 14px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        height: 36px !important;
        padding: 8px 10px !important;
        line-height: 1.4 !important;
        resize: none !important;
        overflow: hidden !important;
        border: none !important;
        background: transparent !important;
    }
    
    /* Send button */
    .send-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
        border-radius: 50% !important;
    }
    
    /* Mic button */
    .mic-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        flex-shrink: 0 !important;
    }
    
    /* Input footer - hide on mobile */
    .input-footer {
        display: none !important;
    }
    
    /* Bottom nav */
    .bottom-nav {
        height: 60px !important;
        padding-bottom: env(safe-area-inset-bottom, 5px) !important;
        display: flex !important;
    }
    
    .bottom-nav .nav-item {
        font-size: 10px !important;
    }
    
    .bottom-nav .nav-item i {
        font-size: 18px !important;
    }
    
    /* Developer credit - HIDE */
    .developer-credit {
        display: none !important;
    }
    
    /* Fixed Voice button - HIDE on mobile to avoid clutter */
    #jarvisOrb {
        display: none !important;
    }
    
    /* Chat messages */
    .messages-area {
        padding: 60px 12px 140px !important;
    }
    
    /* Main content spacing */
    .main-content {
        padding-bottom: 130px !important;
        padding-top: 50px !important;
    }
    
    /* Chat container */
    .chat-container {
        padding-bottom: 130px !important;
    }
    
    /* Image preview */
    .image-preview-container {
        display: none !important;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    #welcomeTitle {
        font-size: 18px !important;
    }
    
    .jarvis-orb-minimal {
        width: 80px !important;
        height: 80px !important;
    }
    
    .chip {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    .model-dropdown-btn .model-name {
        display: none !important;
    }
    
    #messageInput,
    textarea#messageInput {
        font-size: 13px !important;
    }
}

/* ===== VOICE INPUT UI ===== */
.voice-input-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    margin-right: 10px;
    transition: all 0.3s ease;
    opacity: 0.7;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.voice-input-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    opacity: 1;
}

.voice-input-btn:active {
    transform: translateY(0);
}

.voice-status {
    font-size: 12px;
    color: #666;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    margin-left: auto;
    white-space: nowrap;
}

.voice-settings-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.voice-settings-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.voice-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.voice-settings-modal label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    font-size: 14px;
}

.voice-settings-modal input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.voice-settings-modal button {
    margin-top: 15px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.voice-settings-modal button:hover {
    background: #764ba2;
}

/* Voice animation for listening state */
@keyframes voiceWave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.3); }
}

.voice-input-btn.listening {
    animation: voiceWave 0.6s ease-in-out infinite;
}

/* ===== JARVIS 7.0 - PERPLEXITY ENHANCED STYLES [cite: 06-02-2026] ===== */

/* Enhanced Sources Container */
.enhanced-sources {
    animation: fadeInUp 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Model Info Badge */
.model-info-badge {
    animation: slideIn 0.5s ease !important;
}

/* Source Item Hover Effects */
.source-item {
    cursor: pointer;
}

/* JARVIS 7.0 Welcome Badge */
.jarvis-v7-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6);
    }
}

/* Feature Pills */
.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #667eea;
    transition: all 0.3s ease;
}

.feature-pill:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* Enhanced Citation Links */
.source-item a {
    transition: all 0.3s ease !important;
}

.source-item a:hover {
    text-decoration: underline !important;
}

/* Research Indicator Enhancement */
.research-step {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Source Number Badge Animation */
.source-item [style*="background: linear-gradient"] {
    transition: transform 0.3s ease;
}

.source-item:hover [style*="background: linear-gradient"] {
    transform: scale(1.1);
}

/* Mobile Optimizations for JARVIS 7.0 */
@media (max-width: 768px) {
    .enhanced-sources {
        padding: 15px !important;
    }
    
    .source-item {
        padding: 10px 12px !important;
    }
    
    .model-info-badge {
        font-size: 10px !important;
        padding: 4px 10px !important;
    }
    
    .jarvis-v7-badge {
        font-size: 10px !important;
        padding: 6px 12px !important;
    }
}

/* Dark Theme Support for Enhanced Features */
[data-theme="dark"] .enhanced-sources,
[data-theme="chatgpt-pro"] .enhanced-sources {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15)) !important;
}

[data-theme="dark"] .source-item,
[data-theme="chatgpt-pro"] .source-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

[data-theme="dark"] .source-item:hover,
[data-theme="chatgpt-pro"] .source-item:hover {
    background: rgba(102, 126, 234, 0.2) !important;
}

/* Smooth Scrolling for Source Appearance */
.sources-container {
    scroll-margin-top: 100px;
}

/* Loading Shimmer for Sources */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.source-loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===== MAIN CHAT KNOWLEDGE ENGINE ENHANCEMENTS ===== */
.top-sources-wrap {
    margin: 10px 0 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.25);
}

.top-sources-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #667eea;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-sources-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.top-source-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    max-width: 220px;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    transition: all 0.2s ease;
}

.top-source-card:hover {
    transform: translateY(-1px);
    border-color: rgba(102, 126, 234, 0.45);
}

.top-source-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.top-source-text {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-source-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.top-source-domain {
    font-size: 10px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.citation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.28);
    cursor: pointer;
    vertical-align: middle;
}

.citation-badge:hover {
    background: rgba(79, 70, 229, 0.2);
}

.source-card-highlight {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.55), 0 8px 20px rgba(99, 102, 241, 0.2) !important;
    transition: box-shadow 0.2s ease;
}

.knowledge-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 6px 0 12px;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    font-size: 11px;
    color: var(--text-secondary);
}

.metric-pill strong {
    font-size: 11px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.thinking-chip-row {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.thinking-chip {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-secondary);
    animation: thinkingChipPulse 1.6s ease-in-out infinite;
}

.thinking-chip:nth-child(2) { animation-delay: .2s; }
.thinking-chip:nth-child(3) { animation-delay: .4s; }

@keyframes thinkingChipPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
