/* NOBA-RAG Enterprise Styles - Premium Design */

/* CSS Variables - Sophisticated Palette */
:root {
    /* Core Colors - Deep Navy/Slate Theme */
    --primary: #0f172a;
    --primary-light: #1e293b;
    --secondary: #334155;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);
    
    /* Semantic Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Background & Surfaces - Glassmorphism */
    --bg-main: #0b0f19;
    --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #0f172a 100%);
    --surface: rgba(30, 41, 59, 0.6);
    --surface-solid: #1e293b;
    --surface-hover: rgba(51, 65, 85, 0.8);
    --surface-active: rgba(71, 85, 105, 0.9);
    
    /* Border & Effects */
    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(148, 163, 184, 0.25);
    --border-focus: var(--accent);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-blur: blur(16px);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows - Layered for depth */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
    --shadow-inner: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Subtle grid pattern background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.brand-icon i {
    width: 20px;
    height: 20px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.nav-link i {
    width: 18px;
    height: 18px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--accent);
    box-shadow: var(--shadow-glow);
}

/* Nav Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.nav-icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.nav-icon-btn i {
    width: 18px;
    height: 18px;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--error);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 12px 6px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
}

.user-menu:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.user-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-normal);
}

.mobile-menu-btn:hover {
    background: var(--surface-hover);
}

.mobile-menu-btn i {
    width: 20px;
    height: 20px;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    padding-top: 64px;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 300px;
    min-width: 300px;
    height: calc(100vh - 64px);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    overflow: hidden;
}

.sidebar-header {
    margin-bottom: var(--space-md);
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-section-header h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-actions {
    display: flex;
    gap: var(--space-xs);
}

/* Sidebar Search */
.sidebar-search {
    position: relative;
    margin-bottom: var(--space-md);
}

.sidebar-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-family);
    transition: var(--transition-normal);
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Icon Button */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--surface-hover);
    color: var(--accent);
}

/* Documents List */
.documents-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--space-md);
    padding-right: var(--space-xs);
}

/* Scrollbar styling */
.documents-list::-webkit-scrollbar {
    width: 4px;
}

.documents-list::-webkit-scrollbar-track {
    background: transparent;
}

.documents-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.documents-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Document Item */
.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.document-item:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.document-icon {
    width: 32px;
    height: 32px;
    background: var(--info-bg);
    color: var(--info);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.document-icon i {
    width: 16px;
    height: 16px;
}

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

.document-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.document-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.document-delete {
    opacity: 0;
    transition: var(--transition-fast);
}

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

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    color: var(--error);
    background: var(--error-bg);
}

/* Document Skeleton Loading */
.document-skeleton {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.skeleton-icon {
    width: 32px;
    height: 32px;
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    flex: 1;
}

.skeleton-line {
    height: 12px;
    background: var(--surface-hover);
    border-radius: 4px;
    margin-bottom: 6px;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.5; }
}

/* Message Avatar - User small */
.message.user .message-avatar {
    width: 28px;
    height: 28px;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Toast icon */
.toast-icon {
    margin-right: 8px;
    display: flex;
}

.toast-icon i {
    width: 18px;
    height: 18px;
}

.toast.success .toast-icon i {
    color: var(--success);
}

.toast.error .toast-icon i {
    color: var(--error);
}

.toast.warning .toast-icon i {
    color: var(--warning);
}

/* Toast out animation */
@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Empty state with icon */
.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.empty-state i {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Sidebar Footer - Storage Info */
.sidebar-footer {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.storage-info {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
}

.storage-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.storage-header i {
    width: 14px;
    height: 14px;
}

.storage-bar {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #a855f7 100%);
    border-radius: 2px;
    transition: width var(--transition-smooth);
}

.storage-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-lg);
    overflow: hidden;
    min-width: 0;
}

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 0;
    box-shadow: var(--shadow-lg);
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.chat-header h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chat-header h2 i {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--surface-solid);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 4px var(--success);
    }
    50% { 
        opacity: 0.6;
        box-shadow: 0 0 8px var(--success);
    }
}

.status-indicator.processing .status-dot {
    background: var(--warning);
    animation: pulse-glow 1s infinite;
}

.chat-header-actions {
    display: flex;
    gap: var(--space-xs);
}

.header-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.header-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.header-btn i {
    width: 16px;
    height: 16px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Message Base */
.message {
    display: flex;
    gap: var(--space-sm);
    max-width: 85%;
    animation: message-in 0.3s var(--transition-smooth);
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message.system {
    align-self: center;
    max-width: 95%;
}

/* Message Avatar */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    color: white;
    box-shadow: var(--shadow-glow);
}

.message.avatar i {
    width: 16px;
    height: 16px;
}

/* Message Content */
.message-content {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    border: 1px solid var(--border);
}

.message.user .message-content {
    background: var(--surface-solid);
    border-color: var(--accent);
    border-bottom-right-radius: var(--radius-sm);
    box-shadow: 0 0 15px var(--accent-glow);
}

.message.assistant .message-content {
    border-bottom-left-radius: var(--radius-sm);
}

.message.system .message-content {
    background: transparent;
    border: none;
    text-align: center;
    padding: var(--space-md);
}

/* Welcome Message */
.welcome-header {
    margin-bottom: var(--space-md);
}

.welcome-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.welcome-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Feature Cards */
.feature-cards {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.feature-card i {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.welcome-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.message-content p {
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
    line-height: 1.6;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Message Time */
.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Sources */
.sources-list {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.sources-list p {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.source-item {
    color: var(--accent);
    cursor: pointer;
    font-size: 0.75rem;
}

.source-item:hover {
    text-decoration: underline;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: var(--space-sm);
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.quick-action:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-1px);
}

.quick-action i {
    width: 14px;
    height: 14px;
}

/* Chat Input Container */
.chat-input-container {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    transition: var(--transition-normal);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-actions-left,
.input-actions-right {
    display: flex;
    gap: 2px;
    padding-bottom: 2px;
}

.input-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.input-action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.input-action-btn i {
    width: 16px;
    height: 16px;
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    padding: 8px 4px;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

#chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Send Button */
.btn-send {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    flex-shrink: 0;
}

.btn-send i {
    width: 16px;
    height: 16px;
}

.btn-send:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--secondary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.typing-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Upload Dropdown */
.upload-dropdown {
    position: fixed;
    top: 80px;
    right: var(--space-lg);
    width: 360px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    animation: dropdown-in 0.3s var(--transition-smooth);
}

@keyframes dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.dropdown-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.close-dropdown {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.close-dropdown:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.close-dropdown i {
    width: 16px;
    height: 16px;
}

.upload-zone {
    padding: var(--space-xl);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 2px dashed var(--border);
    margin: var(--space-md);
    border-radius: var(--radius-lg);
}

.upload-zone:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    display: flex;
    justify-content: center;
}

.upload-icon i {
    width: 32px;
    height: 32px;
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Upload Progress */
.upload-progress {
    padding: var(--space-md);
    background: var(--surface-solid);
    margin: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.progress-filename {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.progress-percent {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

.progress-bar {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #a855f7 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 1000;
}

.toast {
    padding: var(--space-md) var(--space-lg);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--success);
    animation: toast-in 0.3s var(--transition-smooth);
    max-width: 380px;
    font-size: 0.85rem;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: overlay-in 0.2s var(--transition-normal);
}

@keyframes overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modal-in 0.3s var(--transition-smooth);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.close-modal:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.close-modal i {
    width: 18px;
    height: 18px;
}

.modal-content {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: 60vh;
}

.settings-section {
    margin-bottom: var(--space-lg);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.setting-info {
    display: flex;
    flex-direction: column;
}

.setting-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--secondary);
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Settings Select */
.settings-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-normal);
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* API Key Input */
.api-key-input {
    display: flex;
    gap: var(--space-sm);
}

.api-key-input input {
    flex: 1;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.api-key-input input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    padding: 10px 18px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.btn-primary {
    padding: 10px 18px;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-center {
        display: none;
    }
    
    .brand-tagline {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0 var(--space-md);
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        bottom: 0;
        width: 280px;
        min-width: 280px;
        transform: translateX(-100%);
        transition: transform var(--transition-smooth);
        z-index: 90;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .nav-right {
        display: none;
    }
    
    .main-content {
        padding: var(--space-md);
    }
    
    .chat-section {
        border-radius: var(--radius-lg);
    }
    
    .quick-actions {
        display: none;
    }
    
    .message {
        max-width: 95%;
    }
    
    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md);
    }
    
    .toast {
        max-width: 100%;
    }
    
    .modal {
        width: 95vw;
        margin: var(--space-md);
    }
}

/* Selection Color */
::selection {
    background: var(--accent);
    color: white;
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

/* End of Enterprise Styles */
