/* ===== CSS RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ============================================
       TECHJUMIC COLOR SCHEME - DEFAULT & ENFORCED
       ============================================
       This is the default color scheme for Judemind.
       All themes (light/dark) use these Techjumic colors.
       ============================================ */
    
    /* Techjumic Color Palette - DEFAULT */
    --primary-color: #ff7200;
    --primary-dark: #e65a00;
    --primary-light: #ff8c33;
    --secondary-color: #2563eb;
    --blue-sky: #87ceeb;
    --blue-light: #4da6ff;
    --blue-medium: #1e90ff;
    --blue-dark: #0066cc;
    
    /* Legacy color names for compatibility */
    --primary-purple: #ff7200;
    --primary-purple-light: #ff8c33;
    --primary-teal: #1e90ff;
    --primary-teal-light: #4da6ff;
    --accent-purple: #ff7200;
    --accent-amber: #ff9500;
    --accent-amber-light: #ffaa33;
    
    /* Surface Colors - Toned down from pure black */
    --surface-950: #12121A;
    --surface-900: #1A1B26;
    --surface-850: #242638;
    --surface-800: #2D2F45;
    --surface-700: #374151;
    --surface-600: #4B5563;
    --surface-400: #9CA3AF;
    --surface-300: #D1D5DB;
    --surface-200: #E5E7EB;
    
    /* Background Colors - Legacy names for compatibility */
    --dark-bg: #12121A;
    --dark-bg-secondary: #1A1B26;
    --light-bg: #FFFFFF;
    --light-bg-secondary: #F8FAFC;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    
    /* Text Colors */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-light: #FFFFFF;
    --text-dark: #1a1a2e;
    --text-gray: #666;
    
    /* Border Colors */
    --border-light: #E5E7EB;
    --border-dark: #374151;
    --border-purple: rgba(255, 114, 0, 0.2);
    --border-color: #e0e0e0;
    
    /* Status Colors */
    --success: #10B981;
    --success-500: #10B981;
    --success-400: #34D399;
    --warning: #F59E0B;
    --warning-500: #ff7200;
    --error: #EF4444;
    --error-500: #EF4444;
    --error-400: #F87171;
    --info-500: #1e90ff;
    
    /* Layout */
    --sidebar-width: 320px;
    --navbar-height: 72px;
    --input-height: 56px;
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 40px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-blue: 0 8px 25px rgba(30, 144, 255, 0.2);
    --shadow-glow: 0 0 40px rgba(255, 114, 0, 0.3);
    --shadow-blue-glow: 0 0 40px rgba(30, 144, 255, 0.3);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    
    /* Gradients */
    /* Techjumic Gradients */
    --blue-gradient: linear-gradient(135deg, #87ceeb, #1e90ff);
    --blue-gradient-dark: linear-gradient(135deg, #4da6ff, #0066cc);
    --orange-blue-gradient: linear-gradient(135deg, #ff7200, #1e90ff);
    --blue-orange-gradient: linear-gradient(135deg, #87ceeb, #ff9500);
    
    /* Legacy gradient names for compatibility */
    --gradient-primary: linear-gradient(135deg, #ff7200, #1e90ff);
    --gradient-secondary: linear-gradient(135deg, #87ceeb, #ff9500);
    --gradient-accent: linear-gradient(135deg, #ff7200, #ff9500);
    --gradient-dark: linear-gradient(135deg, var(--surface-900) 0%, var(--surface-950) 100%);
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    /* Default white background - Techjumic style */
    background: 
        linear-gradient(180deg, 
            rgba(249, 250, 251, 0.98) 0%,
            rgba(255, 255, 255, 1) 50%,
            rgba(249, 250, 251, 0.98) 100%),
        radial-gradient(circle at 10% 10%, rgba(255, 114, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(30, 144, 255, 0.05) 0%, transparent 50%),
        var(--bg-white);
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Default is white background - Techjumic style */
html:not([data-theme]) body,
body:not([data-theme="dark"]) {
    background: 
        linear-gradient(180deg, 
            rgba(249, 250, 251, 0.98) 0%,
            rgba(255, 255, 255, 1) 50%,
            rgba(249, 250, 251, 0.98) 100%),
        radial-gradient(circle at 10% 10%, rgba(255, 114, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(30, 144, 255, 0.05) 0%, transparent 50%),
        var(--bg-white);
    background-attachment: fixed;
    color: var(--text-dark);
}

/* Dark theme body background - Techjumic colors enforced */
html[data-theme="dark"] body,
body[data-theme="dark"] {
    background: 
        /* Base gradient */
        linear-gradient(180deg, 
            rgba(10, 10, 15, 0.95) 0%,
            rgba(17, 24, 39, 0.92) 50%,
            rgba(10, 10, 15, 0.95) 100%),
        /* Brand color accent glow effects - Techjumic colors */
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 114, 0, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(30, 144, 255, 0.1) 0%, transparent 50%),
        /* Base dark background */
        var(--surface-950);
    background-attachment: fixed;
    color: var(--text-light);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

/* Dark theme typography */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6 {
    color: var(--text-light);
}

/* ===== NAVIGATION BAR ===== */
/* Default light theme navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 114, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    transition: all var(--transition-normal);
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05) inset, 0 4px 20px rgba(0, 0, 0, 0.05);
}

.top-navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05) inset, 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom-color: rgba(255, 114, 0, 0.2);
}

/* Dark theme navbar */
html[data-theme="dark"] .top-navbar,
body[data-theme="dark"] .top-navbar {
    background: rgba(18, 18, 26, 0.85);
    border-bottom: 1px solid rgba(255, 114, 0, 0.15);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05) inset, 0 4px 20px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .top-navbar.scrolled,
body[data-theme="dark"] .top-navbar.scrolled {
    background: rgba(18, 18, 26, 0.95);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05) inset, 0 8px 32px rgba(0, 0, 0, 0.2);
    border-bottom-color: rgba(255, 114, 0, 0.2);
}

.navbar-left,
.navbar-center,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo Styling - Enhanced Visibility */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.logo-container:hover {
    background: rgba(255, 114, 0, 0.1);
    transform: translateY(-1px);
}

.logo-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-md);
    filter: drop-shadow(0 2px 8px rgba(255, 114, 0, 0.3));
    transition: all var(--transition-normal);
    display: block;
    flex-shrink: 0;
}

.logo-container:hover .logo-image {
    transform: scale(1.08);
    filter: drop-shadow(0 4px 12px rgba(255, 114, 0, 0.4));
}

.logo-text {
    font-size: 1.625rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

/* Navigation Buttons */
.btn-new-chat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.btn-new-chat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 114, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    background: linear-gradient(135deg, var(--primary-purple-light) 0%, var(--primary-teal-light) 100%);
}

.btn-new-chat:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.3);
}

.btn-new-chat:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    background: rgba(255, 114, 0, 0.1);
    padding: var(--space-1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 114, 0, 0.2);
}

.nav-link-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link-item:hover {
    color: var(--accent-purple);
    background: rgba(255, 114, 0, 0.1);
    transform: translateY(-1px);
}

.nav-link-item.active {
    background: rgba(255, 114, 0, 0.15);
    color: var(--accent-purple);
    box-shadow: var(--shadow-sm);
}

.nav-link-item.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-purple));
    border-radius: 2px;
}

/* Version Dropdown Styling */
.version-dropdown {
    position: relative;
}

.version-display {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
}

.version-display:hover {
    background: rgba(255, 114, 0, 0.15);
    color: var(--accent-purple);
}

.version-name {
    font-weight: 600;
}

.version-dropdown.open .version-display {
    background: rgba(255, 114, 0, 0.15);
    color: var(--accent-purple);
}

/* ===== VERSION DROPDOWN (JM) FIXES ===== */

/* Fix dropdown visibility and pointer events */
.version-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--space-1);
    background: rgba(18, 18, 26, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 114, 0, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    padding: var(--space-2) 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1000;
    pointer-events: none;
}

.version-dropdown.open .version-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Fix dropdown item interactions */
.version-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    transition: all var(--transition-fast);
    cursor: pointer;
    gap: var(--space-3);
}

.version-dropdown-item:hover {
    background: rgba(255, 114, 0, 0.15);
}

.version-option {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    flex: 1;
}

/* Fix dropdown arrow alignment */
.dropdown-arrow {
    transition: transform var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--space-1);
}

.version-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.btn-upgrade-small {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(255, 114, 0, 0.3);
}

.btn-upgrade-small:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.4);
}

/* Upgrade Button */
.btn-upgrade {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-upgrade:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* ===== THEME TOGGLE FIXES ===== */

/* Fix theme toggle button display */
.btn-theme-toggle {
    background: rgba(255, 114, 0, 0.1);
    border: 1px solid rgba(255, 114, 0, 0.2);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-light);
    position: relative;
}

.btn-theme-toggle:hover {
    background: rgba(255, 114, 0, 0.2);
    border-color: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.2);
}

/* Fix theme icons */
.theme-icon-sun,
.theme-icon-moon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity var(--transition-fast);
}

.theme-icon-moon {
    display: none;
}

[data-theme="light"] .theme-icon-sun {
    display: none;
}

[data-theme="light"] .theme-icon-moon {
    display: block;
}

[data-theme="dark"] .theme-icon-sun {
    display: block;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

/* Fix light theme button styling */
[data-theme="light"] .btn-theme-toggle {
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.25);
    color: var(--text-primary);
}

[data-theme="light"] .btn-theme-toggle:hover {
    background: rgba(255, 114, 0, 0.15);
    border-color: var(--accent-purple);
}

/* Login Button */
.btn-login-nav {
    padding: 10px 24px;
    background: transparent;
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-login-nav:hover {
    background: var(--primary-purple);
    color: white;
    transform: translateY(-2px);
}

.btn-login-nav:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--primary-purple);
    border-radius: 3px;
    transition: all var(--transition-normal);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== MOBILE MENU ===== */
#mobileMenu {
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    width: 300px;
    max-width: 85vw;
    background: rgba(18, 18, 26, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-left: 1px solid rgba(255, 114, 0, 0.15);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.25);
    z-index: 999;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    display: block;
}

#mobileMenu.show {
    transform: translateX(0);
}

.mobile-menu-content {
    padding: var(--space-4);
}

.mobile-menu-content::before {
    content: 'Powered by Judemy';
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--accent-purple);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid rgba(255, 114, 0, 0.1);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}

.mobile-nav-link {
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: block;
    width: 100%;
}

.mobile-nav-link:hover {
    background: rgba(255, 114, 0, 0.15);
    color: var(--accent-purple);
}

.mobile-actions {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 114, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 998;
    transition: all var(--transition-normal);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== CHAT APP CONTAINER ===== */
.chat-app-container {
    display: flex;
    height: calc(100vh - var(--navbar-height));
    margin-top: var(--navbar-height);
    position: relative;
}

/* ===== SIDEBAR ===== */
/* Default light theme sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid rgba(255, 114, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px solid rgba(255, 114, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 114, 0, 0.03);
}

.sidebar-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.8125rem;
}

/* Dark theme sidebar */
html[data-theme="dark"] .sidebar,
body[data-theme="dark"] .sidebar {
    background: rgba(18, 18, 26, 0.85);
    border-right: 1px solid rgba(255, 114, 0, 0.1);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .sidebar-header,
body[data-theme="dark"] .sidebar-header {
    border-bottom: 1px solid rgba(255, 114, 0, 0.1);
}

html[data-theme="dark"] .sidebar-title,
body[data-theme="dark"] .sidebar-title {
    color: var(--text-light);
}

.btn-sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-sidebar-close:hover {
    background: rgba(255, 114, 0, 0.15);
    color: var(--accent-purple);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Conversations List */
.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: rgba(255, 114, 0, 0.08);
    border-color: rgba(255, 114, 0, 0.15);
    transform: translateX(2px);
}

.conversation-item.active {
    background: rgba(255, 114, 0, 0.12);
    border-color: rgba(255, 114, 0, 0.25);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.15), 0 0 0 1px rgba(255, 114, 0, 0.1) inset;
}

.conversation-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.2);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.2);
    overflow: hidden;
    padding: 4px;
}

.conversation-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    filter: drop-shadow(0 1px 4px rgba(255, 114, 0, 0.3));
}

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

.conversation-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.conversation-preview {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.conversation-delete {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.conversation-item:hover .conversation-delete {
    opacity: 1;
}

.conversation-delete:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-5) var(--space-4);
    border-top: 1px solid rgba(255, 114, 0, 0.1);
    background: rgba(255, 114, 0, 0.02);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.15);
    backdrop-filter: blur(10px);
}

.user-info:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.15);
    background: rgba(255, 114, 0, 0.12);
    transform: translateY(-1px);
}

.user-avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.3);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 2px;
    line-height: 1.4;
}

.user-status {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    line-height: 1.3;
}

/* ===== MAIN CHAT AREA ===== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    background: transparent;
    position: relative;
}

.chat-header {
    padding: var(--space-5) var(--space-8);
    border-bottom: 1px solid rgba(255, 114, 0, 0.1);
    display: flex;
    align-items: center;
    background: rgba(18, 18, 26, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 72px;
}

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-right: 12px;
    transition: all var(--transition-fast);
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 114, 0, 0.15);
    color: var(--accent-purple);
}

/* ===== MESSAGES CONTAINER ===== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-8) var(--space-10);
    scroll-behavior: smooth;
    background: transparent;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height) - 200px);
    padding: 40px 0;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-content {
    max-width: 680px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
    margin: 0 auto;
    padding: var(--space-4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    margin-bottom: 24px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-10);
    background: rgba(255, 114, 0, 0.12);
    border: 2px solid rgba(255, 114, 0, 0.25);
    border-radius: var(--radius-2xl);
    box-shadow: 0 8px 32px rgba(255, 114, 0, 0.2), 0 0 0 1px rgba(255, 114, 0, 0.1) inset;
    backdrop-filter: blur(10px);
    padding: var(--space-4);
}

.welcome-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(255, 114, 0, 0.3));
}

.welcome-badge {
    display: inline-block;
    background: rgba(255, 114, 0, 0.15);
    border: 1px solid rgba(255, 114, 0, 0.3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.15);
}

.welcome-badge-text {
    color: var(--accent-purple);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.welcome-title {
    font-size: 2.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-5);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.welcome-description {
    font-size: 1.1875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-12);
    line-height: 1.7;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.suggested-questions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-top: var(--space-8);
}

@media (min-width: 640px) {
    .suggested-questions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.suggested-question {
    padding: var(--space-4) var(--space-6);
    background: rgba(255, 114, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 114, 0, 0.2);
    border-radius: var(--radius-xl);
    font-size: 0.9375rem;
    color: var(--text-light);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-bounce);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    line-height: 1.5;
}

.suggested-question:hover {
    background: rgba(255, 114, 0, 0.2);
    border-color: var(--accent-purple);
    color: var(--primary-teal-light);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 114, 0, 0.3);
}

/* ===== CHAT INPUT ===== */
.chat-input-container {
    padding: var(--space-6) var(--space-8);
    border-top: 1px solid rgba(255, 114, 0, 0.1);
    background: linear-gradient(180deg, rgba(18, 18, 26, 0.4) 0%, rgba(18, 18, 26, 0.85) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

.chat-input-form {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.file-upload-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    padding: 0;
}

.btn-upload-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 114, 0, 0.2);
    border: 1px solid rgba(255, 114, 0, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-upload-inline:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(255, 114, 0, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-upload-inline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-upload-inline:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* ===== FILE UPLOAD PREVIEW FIXES ===== */

/* Fix file preview container */
.file-preview-container {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.2);
    border-radius: 10px;
    max-height: 60px;
    overflow: hidden;
}

.file-preview-container.has-files {
    display: flex;
}

/* Fix file preview list */
.file-preview-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 4px;
}

/* Fix individual file preview items */
.file-preview-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255, 114, 0, 0.15);
    border: 1px solid rgba(255, 114, 0, 0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.file-preview-item:hover {
    background: rgba(255, 114, 0, 0.2);
    border-color: var(--accent-purple);
    transform: translateY(-1px);
}

/* Fix file preview images */
.file-preview-image {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 114, 0, 0.3);
}

/* Fix file icon container */
.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 114, 0, 0.15);
    border: 1px solid rgba(255, 114, 0, 0.3);
    border-radius: 6px;
    color: var(--accent-purple);
}

.file-icon svg {
    width: 18px;
    height: 18px;
}

/* Fix remove button */
.btn-remove-file {
    position: absolute;
    top: -6px;
    right: -6px;
    background: rgba(239, 68, 68, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    padding: 2px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
}

.btn-remove-file:hover {
    background: var(--error);
    transform: scale(1.1);
}

.btn-remove-file svg {
    width: 10px;
    height: 10px;
    stroke-width: 3;
}

/* Hide file info text */
.file-info,
.file-preview-name,
.file-size {
    display: none;
}

/* Show file name as tooltip on hover */
.file-preview-item:hover::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 18, 26, 0.95);
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid rgba(255, 114, 0, 0.3);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-input-hidden {
    display: none !important;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 114, 0, 0.15);
    border-radius: var(--radius-2xl);
    padding: var(--space-4) var(--space-5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(12px);
}

.input-wrapper:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 16px rgba(255, 114, 0, 0.2), 0 0 0 1px rgba(255, 114, 0, 0.2) inset, 0 0 24px rgba(255, 114, 0, 0.15);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
}

.input-wrapper.error {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.chat-input {
    flex: 1;
    min-height: 28px;
    max-height: 180px;
    padding: var(--space-1) 0;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.7;
    resize: none;
    transition: all var(--transition-fast);
    background: transparent;
    color: var(--text-light);
    font-weight: 400;
    align-self: center;
}

.chat-input:focus {
    outline: none;
}

.chat-input:focus-visible {
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.btn-send {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.btn-send:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 114, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    background: linear-gradient(135deg, var(--primary-purple-light) 0%, var(--primary-teal-light) 100%);
}

.btn-send:active:not(:disabled) {
    transform: translateY(0) scale(0.95);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-send:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* Input Footer */
.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-4);
    padding: 0 var(--space-2);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.char-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.char-count.warning {
    color: var(--warning);
}

.char-count.error {
    color: var(--error);
}

.brand-caption {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-left: auto;
    margin-right: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    letter-spacing: 0.01em;
}

.brand-caption::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(255, 114, 0, 0.5);
}

.input-actions {
    display: flex;
    gap: var(--space-3);
}

.btn-action {
    background: rgba(255, 114, 0, 0.1);
    border: 1px solid rgba(255, 114, 0, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-action:hover {
    background: rgba(255, 114, 0, 0.2);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-sm);
}

.btn-action:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* ===== LOADING OVERLAY (Hidden - Not Used) ===== */
.loading-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ===== MESSAGE BUBBLES ===== */
.message {
    max-width: 85%;
    margin-bottom: 24px;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    50% {
        opacity: 0.5;
        transform: translateY(10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-user {
    margin-left: auto;
}

.message-ai {
    margin-right: auto;
}

.message-content {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.message-user .message-content {
    background: var(--gradient-primary);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(255, 114, 0, 0.25);
}

.message-ai .message-content {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    color: var(--text-light);
    border: 1px solid rgba(255, 114, 0, 0.12);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-avatar {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-shrink: 0;
}

.message-user .message-avatar {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(255, 114, 0, 0.3);
}

.message-user .avatar-initial {
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
}

.message-ai .message-avatar {
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.2);
    padding: 6px;
    box-shadow: 0 2px 8px rgba(255, 114, 0, 0.2);
}

.avatar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    filter: drop-shadow(0 1px 4px rgba(255, 114, 0, 0.3));
}

.message-sender {
    font-size: 0.875rem;
    font-weight: 600;
}

.message-user .message-sender {
    color: white;
}

.message-ai .message-sender {
    color: var(--accent-purple);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.8;
}

/* Typing Indicator */
.thinking-indicator {
    opacity: 1;
    animation: fadeIn 0.3s ease-out;
}

.thinking-indicator .message-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.thinking-indicator .message-text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.thinking-text {
    color: var(--text-light);
    font-size: 0.9375rem;
    font-weight: 500;
    opacity: 0.9;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
    display: inline-block;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Error Message */
.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1440px) {
    .top-navbar {
        padding: 0 var(--space-6);
    }
    
    .chat-header {
        padding: var(--space-5) var(--space-6);
    }
}

@media (max-width: 1024px) {
    :root {
        --navbar-height: 68px;
        --sidebar-width: 300px;
    }
    
    .top-navbar {
        height: 68px;
        padding: 0 var(--space-5);
    }
    
    .chat-app-container {
        margin-top: 68px;
        height: calc(100vh - 68px);
    }
    
    .sidebar {
        top: 68px;
        transform: translateX(-100%);
        width: 300px;
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.25);
        transition: transform var(--transition-normal);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .chat-main {
        margin-left: 0;
    }
    
    .btn-sidebar-toggle,
    .btn-sidebar-close {
        display: block;
    }
    
    .navbar-center {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .message {
        max-width: 90%;
    }
    
    .logo-image {
        width: 42px;
        height: 42px;
    }
    
    .logo-text {
        font-size: 1.375rem;
    }
    
    /* Simplify gradients on tablet */
    /* Default is white background */
    body {
        background: #FFFFFF !important;
    }
    
    html[data-theme="dark"] body,
    body[data-theme="dark"] {
        background: var(--surface-950) !important;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 64px;
    }
    
    .top-navbar {
        height: 64px;
        padding: 0 var(--space-4);
    }
    
    .top-navbar.scrolled {
        background: rgba(18, 18, 26, 0.98);
    }
    
    .chat-app-container {
        margin-top: 64px;
        height: calc(100vh - 64px);
    }
    
    .sidebar {
        top: 64px;
        width: 280px;
    }
    
    .logo-image {
        width: 38px;
        height: 38px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .navbar-left {
        gap: var(--space-3);
    }
    
    .btn-new-chat span {
        display: none;
    }
    
    .btn-new-chat {
        padding: var(--space-2);
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .chat-header {
        padding: var(--space-3) var(--space-4);
        min-height: 64px;
    }
    
    .messages-container {
        padding: var(--space-4);
    }
    
    .chat-input-container {
        padding: var(--space-4);
    }
    
    .welcome-title {
        font-size: 1.875rem;
    }
    
    .welcome-description {
        font-size: 1rem;
    }
    
    .suggested-questions {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
    }
    
    .conversation-icon {
        width: 36px;
        height: 36px;
    }
    
    .brand-caption {
        display: none;
    }
    
    .input-footer {
        flex-wrap: wrap;
        gap: var(--space-3);
    }
    
    .char-count {
        order: 1;
    }
    
    .input-actions {
        order: 2;
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    :root {
        --navbar-height: 60px;
    }
    
    .top-navbar {
        height: 60px;
        padding: 0 var(--space-3);
    }
    
    .chat-app-container {
        margin-top: 60px;
        height: calc(100vh - 60px);
    }
    
    .sidebar {
        top: 60px;
        width: 100%;
        max-width: 320px;
    }
    
    .logo-image {
        width: 36px;
        height: 36px;
    }
    
    .logo-text {
        font-size: 1.125rem;
    }
    
    .navbar-left {
        gap: var(--space-2);
    }
    
    .btn-new-chat {
        width: 36px;
        height: 36px;
        min-width: 36px;
        padding: var(--space-1);
    }
    
    .chat-header {
        padding: var(--space-3);
        min-height: 60px;
    }
    
    .messages-container {
        padding: var(--space-3);
    }
    
    .chat-input-container {
        padding: var(--space-3);
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .welcome-description {
        font-size: 0.9375rem;
    }
    
    .suggested-questions {
        gap: var(--space-2);
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .conversation-icon {
        width: 32px;
        height: 32px;
    }
    
    .message-content {
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
    }
    
    .input-wrapper {
        padding: var(--space-3);
    }
    
    .btn-send {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 360px) {
    .top-navbar {
        padding: 0 var(--space-2);
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .welcome-title {
        font-size: 1.375rem;
    }
    
    .messages-container,
    .chat-input-container {
        padding: var(--space-2);
    }
    
    .sidebar {
        width: 100%;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .top-navbar,
    .sidebar,
    .chat-input-container {
        backdrop-filter: blur(8px);
    }
    
    .message {
        animation: none;
    }
    
    .spinner {
        animation: spin 2s linear infinite;
    }
}

/* Custom Scrollbar */
.messages-container::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 114, 0, 0.4);
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

.messages-container::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 114, 0, 0.6);
}

/* ===== THEME BACKGROUND FIX ===== */

/* Fix light theme background variables */
[data-theme="light"] {
    /* Override text colors for light theme */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --text-light: #111827;
}

/* Ensure HTML element also gets light background */
[data-theme="light"] html {
    background: #FFFFFF;
}

html[data-theme="light"] body,
[data-theme="light"] body,
body.light-theme {
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 114, 0, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(30, 144, 255, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #F8FAFC 50%, #FFFFFF 100%),
        #FFFFFF !important;
    background-attachment: fixed !important;
    background-color: #FFFFFF !important;
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 114, 0, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(30, 144, 255, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #F8FAFC 50%, #FFFFFF 100%),
        #FFFFFF !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] .top-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 114, 0, 0.2);
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.02) inset, 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .top-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.02) inset, 0 8px 32px rgba(0, 0, 0, 0.08);
    border-bottom-color: rgba(255, 114, 0, 0.25);
}

[data-theme="light"] .logo-text {
    color: var(--text-primary);
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid rgba(255, 114, 0, 0.15);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .sidebar-header {
    background: rgba(255, 114, 0, 0.05);
    border-bottom: 1px solid rgba(255, 114, 0, 0.15);
}

[data-theme="light"] .sidebar-title {
    color: var(--text-primary);
}

[data-theme="light"] .conversation-item {
    color: var(--text-primary);
}

[data-theme="light"] .conversation-item:hover {
    background: rgba(255, 114, 0, 0.08);
    border-color: rgba(255, 114, 0, 0.2);
}

[data-theme="light"] .conversation-item.active {
    background: rgba(255, 114, 0, 0.12);
    border-color: rgba(255, 114, 0, 0.3);
}

[data-theme="light"] .conversation-title {
    color: var(--text-primary);
}

[data-theme="light"] .conversation-preview {
    color: var(--text-secondary);
}

[data-theme="light"] .user-info {
    background: rgba(255, 114, 0, 0.05);
    border: 1px solid rgba(255, 114, 0, 0.2);
}

[data-theme="light"] .user-name {
    color: var(--text-primary);
}

[data-theme="light"] .user-status {
    color: var(--text-secondary);
}

[data-theme="light"] .chat-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(255, 114, 0, 0.15);
}

[data-theme="light"] .message-ai .message-content {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 114, 0, 0.2);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.02) inset;
}

[data-theme="light"] .message-user .message-content {
    background: var(--gradient-primary);
    color: white;
}

[data-theme="light"] .message-ai .message-avatar {
    background: rgba(255, 114, 0, 0.05);
    border: 1px solid rgba(255, 114, 0, 0.25);
}

[data-theme="light"] .conversation-icon {
    background: rgba(255, 114, 0, 0.05);
    border: 1px solid rgba(255, 114, 0, 0.25);
}

[data-theme="light"] .conversation-logo,
[data-theme="light"] .avatar-logo {
    filter: drop-shadow(0 1px 4px rgba(255, 114, 0, 0.2));
}

[data-theme="light"] .message-ai .message-sender {
    color: var(--primary-purple);
}

[data-theme="light"] .message-time {
    color: var(--text-secondary);
}

[data-theme="light"] .chat-input-container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 114, 0, 0.15);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .input-wrapper {
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(255, 114, 0, 0.2);
}

[data-theme="light"] .input-wrapper:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 16px rgba(255, 114, 0, 0.15), 0 0 0 1px rgba(255, 114, 0, 0.2) inset, 0 0 24px rgba(255, 114, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .chat-input {
    background: transparent;
    color: var(--text-primary);
}

[data-theme="light"] .chat-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="light"] .file-upload-bar {
    background: transparent;
}

[data-theme="light"] .btn-upload-inline {
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.25);
    color: var(--text-primary);
}

[data-theme="light"] .btn-upload-inline:hover {
    background: rgba(255, 114, 0, 0.15);
    border-color: var(--accent-purple);
    color: var(--primary-purple);
}

/* Light theme file preview styles */
[data-theme="light"] .file-preview-container {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 114, 0, 0.25);
}

[data-theme="light"] .file-preview-item {
    background: rgba(255, 114, 0, 0.1);
    border: 1px solid rgba(255, 114, 0, 0.3);
}

[data-theme="light"] .file-preview-item:hover::before {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    border: 1px solid rgba(255, 114, 0, 0.3);
}

[data-theme="light"] .welcome-badge {
    background: rgba(255, 114, 0, 0.1);
    border: 1px solid rgba(255, 114, 0, 0.3);
}

[data-theme="light"] .welcome-badge-text {
    color: var(--primary-purple);
}

[data-theme="light"] .welcome-title {
    color: var(--text-primary);
}

[data-theme="light"] .welcome-description {
    color: var(--text-secondary);
}

[data-theme="light"] .suggested-question {
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(255, 114, 0, 0.25);
    color: var(--text-primary);
}

[data-theme="light"] .suggested-question:hover {
    background: rgba(255, 114, 0, 0.1);
    border-color: var(--accent-purple);
    color: var(--primary-purple);
}

[data-theme="light"] .thinking-text {
    color: var(--text-primary);
}

[data-theme="light"] .char-count {
    color: var(--text-secondary);
}

[data-theme="light"] .brand-caption {
    color: var(--text-secondary);
}

[data-theme="light"] .btn-action {
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.2);
    color: var(--text-secondary);
}

[data-theme="light"] .btn-action:hover {
    background: rgba(255, 114, 0, 0.15);
    color: var(--primary-purple);
    border-color: var(--accent-purple);
}

[data-theme="light"] .nav-links {
    background: rgba(255, 114, 0, 0.08);
    border: 1px solid rgba(255, 114, 0, 0.25);
}

[data-theme="light"] .nav-link-item {
    color: var(--text-secondary);
}

[data-theme="light"] .nav-link-item:hover {
    color: var(--primary-purple);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .nav-link-item.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-purple);
}

/* Fix light theme dropdown */
[data-theme="light"] .version-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 114, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.02) inset;
}

[data-theme="light"] .version-option {
    color: var(--text-primary);
}

[data-theme="light"] .version-dropdown-item:hover {
    background: rgba(255, 114, 0, 0.08);
}

[data-theme="light"] .version-display {
    color: var(--text-secondary);
}

[data-theme="light"] .version-display:hover {
    background: rgba(255, 114, 0, 0.1);
    color: var(--primary-purple);
}

[data-theme="light"] .version-dropdown.open .version-display {
    background: rgba(255, 114, 0, 0.1);
    color: var(--primary-purple);
}

/* Mobile responsiveness for dropdown */
@media (max-width: 768px) {
    .version-dropdown-menu {
        position: fixed;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        min-width: 200px;
        max-width: 90vw;
    }
    
    .version-dropdown.open .version-dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }
}

[data-theme="light"] #mobileMenu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-left: 1px solid rgba(255, 114, 0, 0.2);
}

[data-theme="light"] .mobile-nav-link {
    color: var(--text-primary);
}

[data-theme="light"] .mobile-nav-link:hover {
    background: rgba(255, 114, 0, 0.1);
    color: var(--primary-purple);
}

[data-theme="light"] .messages-container::-webkit-scrollbar-thumb,
[data-theme="light"] .sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 114, 0, 0.2);
}

[data-theme="light"] .messages-container::-webkit-scrollbar-thumb:hover,
[data-theme="light"] .sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 114, 0, 0.4);
}