/* ===== JARVIS AI - PROFESSIONAL WORLD-CLASS INTERFACE ===== */
/* Designed for 30,000+ Students - College Submission Grade */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Professional Color System */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* Neutral Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Dark Theme */
    --bg-primary: #0f1419;
    --bg-secondary: #16181d;
    --bg-tertiary: #1e2128;
    --bg-elevated: #252932;
    --bg-hover: #2a2f38;
    
    /* Text */
    --text-primary: #e7e9ea;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --text-inverse: #0f1419;
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    
    /* Effects */
    --blur-sm: 4px;
    --blur-md: 8px;
    --blur-lg: 16px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GLOBAL RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== HEADER NAVIGATION BUTTON STYLING ===== */
.header-btn {
    padding: 0.6rem 1.2rem !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 10px !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.header-btn:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    color: var(--text-primary) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

.header-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    margin-left: auto;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.sidebar-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* New Chat Button */
.new-chat-btn {
    margin: 12px;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.new-chat-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.new-chat-btn:active {
    transform: scale(0.98);
}

/* Chat History */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-history h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 12px 4px;
    margin-bottom: 4px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-tertiary);
}

.history-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.3;
    display: block;
}

.history-empty p {
    font-size: 13px;
    line-height: 1.5;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 13px;
    gap: 8px;
}

.history-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.history-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 500;
}

.chat-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-chat-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--error);
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
}

.history-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
}

.theme-selector-container {
    margin-bottom: 8px;
}

.theme-selector-container label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 6px;
}

.theme-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.theme-select:hover {
    border-color: var(--border-strong);
}

.theme-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sidebar-account-btn {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.sidebar-account-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

/* ===== HEADER ===== */
.header {
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-brain-icon {
    font-size: 20px;
    color: var(--primary-500);
}

.header h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.learning-platform-link,
.playground-link,
.project-gen-link,
.dashboard-link,
.ai-tools-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.learning-platform-link:hover,
.playground-link:hover,
.project-gen-link:hover,
.dashboard-link:hover,
.ai-tools-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.settings-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== MODE SELECTOR ===== */
.mode-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mode-tab:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--primary-600);
    color: white;
}

.mode-indicator {
    display: none;
}

/* ===== CHAT CONTAINER ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ai-tools-unique-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.ai-tools-unique-content .container {
    max-width: 900px;
    margin: 0 auto;
}

.ai-tools-unique-content .header {
    text-align: center;
    margin-bottom: 48px;
}

.ai-tools-unique-content .header h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-tools-unique-content .header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Welcome Screen */
.welcome-screen {
    max-width: 768px;
    margin: 0 auto;
    padding: 40px 24px;
    text-align: center;
}

.welcome-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    font-weight: 400;
}

/* JARVIS Orb - Minimal & Professional */
.jarvis-orb-3d {
    width: 120px;
    height: 120px;
    margin: 32px auto;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.jarvis-orb-3d:hover {
    transform: scale(1.05);
}

.orb-core-3d {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-inner {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.4);
    transition: box-shadow var(--transition-base);
}

.jarvis-orb-3d:hover .core-inner {
    box-shadow: 0 0 80px rgba(59, 130, 246, 0.6);
}

/* Hide old complex animations */
.orb-ring-outer, .orb-ring-middle, .orb-ring-inner,
.orb-hexagon, .orb-particles, .core-glow {
    display: none !important;
}

.voice-hint {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 16px;
}

.voice-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.mode-description {
    margin-bottom: 24px;
}

.mode-description p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* AI Tools Hub */
.ai-tools-hub {
    margin-top: 48px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.ai-tools-hub h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-bottom: 24px;
}

.tool-card:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.2);
}

.tool-card.current {
    border-color: var(--primary-500);
    background: var(--bg-elevated);
}

.tool-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
}

.tool-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.tool-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.api-status {
    text-align: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 8px;
}

.status-text {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Example Prompts */
.example-prompts {
    margin-top: 40px;
}

.example-prompts h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.prompt-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-base);
}

.prompt-card:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-500);
    transform: translateY(-2px);
}

.prompt-card i {
    font-size: 24px;
    color: var(--primary-500);
}

.prompt-card span {
    font-size: 14px;
    font-weight: 500;
}

/* ===== MESSAGES AREA ===== */
.messages-area {
    max-width: 768px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    background: var(--bg-elevated);
}

.message.user .message-avatar {
    background: var(--primary-600);
    color: white;
}

.message.ai .message-avatar {
    background: var(--bg-elevated);
    color: var(--primary-500);
}

.message-content {
    flex: 1;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.message.user .message-content {
    background: var(--primary-600);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
}

.message.ai .message-content {
    padding: 4px 0;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ===== INPUT AREA ===== */
.input-area {
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.input-container {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    transition: var(--transition-fast);
}

.input-container:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.attach-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.attach-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 8px;
    min-height: 24px;
    max-height: 200px;
}

textarea::placeholder {
    color: var(--text-tertiary);
}

.mic-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.mic-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mic-btn.listening {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.send-btn {
    background: var(--primary-600);
    border: none;
    color: white;
    font-size: 18px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--primary-700);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    max-width: 768px;
    margin: 8px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 0 4px;
}

.char-count {
    font-family: 'JetBrains Mono', monospace;
}

/* ===== DEVELOPER CREDIT ===== */
.developer-credit {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
}

.developer-credit strong {
    color: var(--primary-500);
    font-weight: 600;
}

/* ===== SETTINGS MODAL ===== */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(var(--blur-sm));
    backdrop-filter: blur(var(--blur-sm));
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.settings-modal.show {
    display: flex;
}

.settings-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.settings-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-settings {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.close-settings:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-body {
    padding: 20px;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-selector {
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.voice-toggle-btn {
    padding: 6px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.voice-toggle-btn:hover {
    background: var(--bg-hover);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--success);
}

.status-indicator i {
    font-size: 8px;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100%;
        z-index: 1000;
        transition: left var(--transition-base);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar-close-btn {
        display: block;
    }
    
    .header-actions span {
        display: none;
    }
    
    .welcome-content h1 {
        font-size: 32px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .messages-area {
        padding: 16px;
    }
}

/* ===== GEMINI-STYLE MOBILE OPTIMIZATIONS ===== */
@media (max-width: 500px) {
    body {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
    }

    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-bottom: 60px;
    }

    /* Header */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 12px !important;
        z-index: 100;
        background: var(--bg-primary);
    }

    .header-actions {
        display: none !important;
    }

    .header-center h1 {
        font-size: 16px !important;
    }

    /* Mode Selector */
    .mode-selector {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        z-index: 99;
        padding: 8px 12px;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-subtle);
    }

    .mode-tab {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 20px;
    }

    /* Chat Container / Tools Container */
    .chat-container {
        flex: 1;
        overflow-y: auto;
        padding-top: 110px;
        padding-bottom: 80px;
        -webkit-overflow-scrolling: touch;
    }

    /* Tool Cards */
    .tool-card {
        margin: 12px;
        padding: 16px;
        border-radius: 16px;
    }

    .tool-header h2 {
        font-size: 18px !important;
    }

    .tool-header p {
        font-size: 13px;
    }

    .input-group textarea,
    .input-group input {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 14px;
        min-height: 100px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 15px;
        min-width: auto;
        width: 100%;
        min-height: 48px;
        border-radius: 24px;
    }

    .btn-primary:active {
        transform: scale(0.97);
    }

    .output-area {
        padding: 14px;
        font-size: 14px;
        border-radius: 12px;
    }

    /* Bottom Navigation */
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 60px !important;
        background: var(--bg-primary) !important;
        border-top: 1px solid var(--border-subtle) !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        z-index: 1000 !important;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px;
        color: var(--text-tertiary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
    }

    .bottom-nav .nav-item i {
        font-size: 20px;
    }

    .bottom-nav .nav-item.active {
        color: var(--primary-500);
    }

    /* Settings Modal */
    .settings-modal-content {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
    }
}

/* ===== 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;
}

/* ===== BUTTON LOADING STATES ===== */
.hidden {
    display: none !important;
}

.btn-loader {
    display: none;
    align-items: center;
    gap: 8px;
}

.btn-loader .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== ERROR AND LOADING STATES ===== */
.error-message {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #fca5a5;
    margin-top: 16px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== CHAT BUBBLES & OUTPUT ===== */
.chat-bubble {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
    animation: fadeInUp 0.3s ease-out;
}

.concept-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-400);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.provider-badge {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: var(--primary-400);
    font-weight: 500;
}

.image-container {
    margin-top: 16px;
    animation: fadeInUp 0.3s ease-out;
}

.generated-image {
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    border: 1px solid var(--border-default);
    margin-bottom: 16px;
}

.image-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.image-info p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.image-info strong {
    color: var(--text-primary);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-600);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--primary-700);
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PROJECT GENERATOR STYLES ===== */
.project-options {
    display: flex;
    gap: 12px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.project-select {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-select:hover {
    border-color: var(--primary-500);
    background: var(--bg-elevated);
}

.project-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#projectInput {
    width: 100%;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
}

#projectInput:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Project Output Container */
.project-container {
    animation: fadeInUp 0.5s ease;
}

.project-header {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.project-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.project-files {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.file-item {
    border-bottom: 1px solid var(--border-subtle);
}

.file-item:last-child {
    border-bottom: none;
}

.file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-header:hover {
    background: var(--bg-hover);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.file-icon {
    font-size: 18px;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.copy-btn {
    padding: 6px 12px;
    background: var(--primary-600);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: var(--success);
}

.expand-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.file-content {
    display: none;
    padding: 0;
    background: #1e1e1e;
    overflow: hidden;
}

.file-content.expanded {
    display: block;
}

.code-block {
    margin: 0;
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-block::-webkit-scrollbar {
    height: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.code-block::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.project-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.download-all-btn {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* File type icons */
.file-icon.html { color: #e34c26; }
.file-icon.css { color: #264de4; }
.file-icon.js { color: #f7df1e; }
.file-icon.py { color: #3776ab; }
.file-icon.java { color: #007396; }
.file-icon.cpp { color: #00599c; }
.file-icon.json { color: #5a9e4d; }
.file-icon.md { color: #ffffff; }
.file-icon.txt { color: #9ca3af; }

/* ===== SETUP INSTRUCTIONS STYLES ===== */
.setup-instructions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
}

.setup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.setup-header:hover {
    background: var(--bg-hover);
}

.setup-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setup-title h4 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.setup-title i {
    color: var(--primary-500);
    font-size: 20px;
}

.setup-header > i {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.setup-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.setup-content.expanded {
    max-height: 2000px;
}

.setup-steps {
    padding: 20px;
}

.setup-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.setup-step:last-child {
    margin-bottom: 0;
}

.step-number {
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h5 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.step-content p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.command-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    margin: 8px 0;
    overflow-x: auto;
    border-left: 3px solid var(--primary-500);
}

.file-list {
    margin: 8px 0;
    padding-left: 20px;
}

.file-list li {
    margin: 6px 0;
    color: var(--text-secondary);
}

.file-list code {
    color: var(--primary-400);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.step-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-500);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== FULL CODE OUTPUT STYLES ===== */
.full-code-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
}

.code-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-output-header:hover {
    background: var(--bg-hover);
}

.code-output-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-output-title h4 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.code-output-title i {
    color: var(--success);
    font-size: 20px;
}

.file-count {
    background: var(--primary-600);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.code-output-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.code-output-content.expanded {
    max-height: 100000px;
}

.code-output-actions {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.copy-all-btn,
.expand-all-btn,
.collapse-all-btn {
    padding: 8px 16px;
    background: var(--primary-600);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-all-btn:hover,
.expand-all-btn:hover,
.collapse-all-btn:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

.expand-all-btn {
    background: var(--success);
}

.expand-all-btn:hover {
    background: #059669;
}

.collapse-all-btn {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.collapse-all-btn:hover {
    background: var(--bg-hover);
}

.line-count {
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 2px 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    margin-left: 8px;
}

.file-toggle-icon {
    transition: transform 0.2s ease;
}

.file-header {
    cursor: pointer;
}

.project-files {
    background: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

/* ===== AI TOOLS BUTTON STYLING ===== */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.tool-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.input-group textarea,
.input-group input {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.input-group textarea:focus,
.input-group input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.output-area {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    min-height: 100px;
    color: var(--text-primary);
    line-height: 1.8;
}
