/* ================================================================
   IntellectRAG Engine — Premium 3D Responsive Stylesheet
   Corporate Blue & Dark Slate Theme with Glassmorphism
   ================================================================ */
/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');
/* ---------- CSS Variables / Design Tokens ---------- */
:root {
  /* Core palette */
  --brand-primary: #0062ff;
  --brand-primary-light: #3d8bfd;
  --brand-primary-dark: #003ecb;
  --brand-accent: #00d4ff;
  --brand-accent-glow: rgba(0, 212, 255, 0.25);
  /* Surface colors */
  --surface-bg: #060b18;
  --surface-card: rgba(12, 20, 42, 0.75);
  --surface-card-hover: rgba(18, 30, 60, 0.85);
  --surface-elevated: rgba(20, 35, 70, 0.6);
  --surface-input: rgba(10, 18, 38, 0.9);
  --surface-overlay: rgba(0, 0, 0, 0.55);
  /* Text */
  --text-primary: #f0f4ff;
  --text-secondary: #8899be;
  --text-muted: #4e5f82;
  --text-accent: #00d4ff;
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 212, 255, 0.2);
  --border-active: rgba(0, 98, 255, 0.5);
  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #060b18 0%, #0a1628 40%, #0d1f3c 100%);
  --gradient-card: linear-gradient(145deg, rgba(15, 25, 50, 0.9) 0%, rgba(8, 14, 30, 0.95) 100%);
  --gradient-accent: linear-gradient(135deg, #0062ff 0%, #00d4ff 100%);
  --gradient-accent-soft: linear-gradient(135deg, rgba(0, 98, 255, 0.15) 0%, rgba(0, 212, 255, 0.08) 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(0, 98, 255, 0.12) 0%, transparent 70%);
  /* Shadows */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 98, 255, 0.08);
  --shadow-glow: 0 0 40px rgba(0, 98, 255, 0.15), 0 0 80px rgba(0, 212, 255, 0.05);
  --shadow-button: 0 4px 20px rgba(0, 98, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-3d: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  /* 3D / Perspective */
  --perspective: 1200px;
  --rotate-subtle: 1deg;
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Layout */
  --sidebar-width: 380px;
  --header-height: 64px;
  --chat-input-height: 80px;
}
/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--surface-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}
/* ---------- Animated Background ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0, 98, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(0, 212, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(0, 98, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 12s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}
/* Floating orb decorations */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}
.bg-orb--1 {
  width: 400px;
  height: 400px;
  background: rgba(0, 98, 255, 0.07);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}
.bg-orb--2 {
  width: 300px;
  height: 300px;
  background: rgba(0, 212, 255, 0.05);
  bottom: -80px;
  right: -80px;
  animation-delay: -7s;
}
.bg-orb--3 {
  width: 250px;
  height: 250px;
  background: rgba(0, 98, 255, 0.04);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(15px, 15px) scale(1.02); }
}
/* ---------- Grid Lines Background ---------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
/* ---------- App Shell ---------- */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}
/* ---------- Header ---------- */
.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}
.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-accent);
  opacity: 0.3;
}
.header__brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}
.header__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow-button);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.header__logo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.2) 50%, transparent 60%);
  animation: logoShine 3s ease-in-out infinite;
}
@keyframes logoShine {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}
.header__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header__subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}
.header__status {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}
.status-badge {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 14px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-accent);
  font-weight: 500;
  transition: var(--transition-base);
}
.status-badge:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.25);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
  animation: statusPulse 2s ease-in-out infinite;
}
.status-dot--inactive {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
/* Hamburger menu button (mobile only) */
.header__menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-base);
  flex-shrink: 0;
}
.header__menu-btn:hover {
  background: var(--surface-elevated);
  border-color: var(--border-glow);
}
.header__menu-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
/* ---------- Main Layout (Split View) ---------- */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}
/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--gradient-card);
  border-right: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(0, 212, 255, 0.15), transparent);
}
.sidebar__section {
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar__section:last-child {
  border-bottom: none;
  flex: 1;
  overflow-y: auto;
}
.sidebar__section:last-child::-webkit-scrollbar {
  width: 4px;
}
.sidebar__section:last-child::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar__section:last-child::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}
.section-title svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
/* ---------- Upload Zone (3D Card) ---------- */
.upload-zone {
  perspective: var(--perspective);
}
.upload-card {
  position: relative;
  border: 2px dashed rgba(0, 98, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl) var(--spacing-xl);
  text-align: center;
  cursor: pointer;
  background: var(--gradient-accent-soft);
  transition: var(--transition-base);
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  overflow: hidden;
}
.upload-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 212, 255, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  border-radius: inherit;
}
.upload-card:hover {
  border-color: rgba(0, 98, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.upload-card:hover::before {
  opacity: 1;
}
.upload-card.drag-over {
  border-color: var(--brand-accent);
  background: rgba(0, 212, 255, 0.08);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.15);
}
.upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--spacing-lg);
  border-radius: var(--radius-md);
  background: rgba(0, 98, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary-light);
  transition: var(--transition-base);
}
.upload-card:hover .upload-icon {
  background: rgba(0, 98, 255, 0.2);
  transform: scale(1.05);
}
.upload-icon svg {
  width: 26px;
  height: 26px;
}
.upload-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}
.upload-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.upload-input {
  display: none;
}
/* ---------- Upload Progress ---------- */
.upload-progress {
  display: none;
  margin-top: var(--spacing-lg);
}
.upload-progress.active {
  display: block;
  animation: fadeSlideUp 0.4s var(--transition-base);
}
.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShimmer 1.5s infinite;
}
@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}
/* ---------- File List ---------- */
.file-list {
  list-style: none;
}
.file-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-xs);
  transition: var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.file-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-accent-soft);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.file-item:hover::before {
  opacity: 1;
}
.file-item:hover {
  transform: translateX(4px);
}
.file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 98, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.file-icon svg {
  width: 18px;
  height: 18px;
  color: var(--brand-primary-light);
}
.file-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.file-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.file-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}
.file-badge--ready {
  background: rgba(0, 230, 118, 0.1);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.2);
}
.file-badge--processing {
  background: rgba(255, 183, 77, 0.1);
  color: #ffb74d;
  border: 1px solid rgba(255, 183, 77, 0.2);
}
/* ---------- Parameters Panel ---------- */
.param-group {
  margin-bottom: var(--spacing-lg);
}
.param-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.param-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-accent);
}
.param-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  outline: none;
  transition: var(--transition-base);
}
.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 98, 255, 0.4);
  transition: var(--transition-base);
}
.param-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(0, 98, 255, 0.6);
}
.param-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 98, 255, 0.4);
}
.param-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition-base);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238899be' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.param-select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.1);
}
/* ---------- Chat Area ---------- */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: transparent;
}
/* Chat Messages Container */
.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  scroll-behavior: smooth;
}
.chat__messages::-webkit-scrollbar {
  width: 6px;
}
.chat__messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
}
.chat__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}
/* Welcome Screen */
.chat__welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: var(--spacing-3xl);
  animation: fadeSlideUp 0.8s ease;
}
.welcome-icon {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-xl);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-2xl);
  box-shadow: var(--shadow-glow);
  position: relative;
  animation: welcomePulse 4s ease-in-out infinite;
}
.welcome-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: var(--gradient-accent);
  opacity: 0.2;
  filter: blur(15px);
  z-index: -1;
}
.welcome-icon svg {
  width: 48px;
  height: 48px;
  color: white;
}
@keyframes welcomePulse {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow-glow); }
  50% { transform: scale(1.03); box-shadow: 0 0 60px rgba(0, 98, 255, 0.25), 0 0 120px rgba(0, 212, 255, 0.08); }
}
.welcome-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: var(--spacing-2xl);
}
/* Feature Cards (3D) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  max-width: 680px;
  width: 100%;
  perspective: var(--perspective);
}
.feature-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  text-align: center;
  transition: var(--transition-base);
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
  cursor: default;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 212, 255, 0.06) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-elevated);
}
.feature-card:hover::before {
  opacity: 1;
}
.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 98, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md);
  color: var(--brand-primary-light);
  transition: var(--transition-base);
}
.feature-card:hover .feature-card__icon {
  background: rgba(0, 98, 255, 0.18);
  transform: scale(1.08);
}
.feature-card__icon svg {
  width: 22px;
  height: 22px;
}
.feature-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}
.feature-card__desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}
/* ---------- Chat Messages ---------- */
.message {
  display: flex;
  gap: var(--spacing-md);
  max-width: 85%;
  animation: messageSlideIn 0.4s ease;
  position: relative;
}
.message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.message--assistant {
  align-self: flex-start;
}
@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.message__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
}
.message--user .message__avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}
.message--assistant .message__avatar {
  background: var(--gradient-accent);
  color: white;
}
.message__content {
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.7;
  position: relative;
}
.message--user .message__content {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-top-right-radius: var(--radius-xs, 4px);
  color: var(--text-primary);
}
.message--assistant .message__content {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: var(--radius-xs, 4px);
  color: var(--text-primary);
}
.message__sources {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-subtle);
}
.message__sources-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}
.source-chip {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(0, 98, 255, 0.08);
  border: 1px solid rgba(0, 98, 255, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin: 2px 4px 2px 0;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
  animation: fadeSlideUp 0.3s ease;
}
.typing-indicator__dots {
  display: flex;
  gap: 4px;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
}
.typing-indicator__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-indicator__dot:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-indicator__dot:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}
/* ---------- Chat Input ---------- */
.chat__input-area {
  padding: var(--spacing-lg) var(--spacing-2xl) var(--spacing-xl);
  background: linear-gradient(to top, rgba(6, 11, 24, 0.95) 0%, transparent 100%);
  position: relative;
}
.chat__input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-md);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-sm);
  transition: var(--transition-base);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.chat__input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 4px rgba(0, 98, 255, 0.08), var(--shadow-card);
}
.chat__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  padding: var(--spacing-md) var(--spacing-lg);
  resize: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
}
.chat__input::placeholder {
  color: var(--text-muted);
}
.chat__send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-accent);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  flex-shrink: 0;
  box-shadow: var(--shadow-button);
}
.chat__send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(0, 98, 255, 0.4);
}
.chat__send-btn:active {
  transform: scale(0.95);
}
.chat__send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.chat__send-btn svg {
  width: 20px;
  height: 20px;
}
.chat__input-hint {
  text-align: center;
  padding-top: var(--spacing-sm);
  font-size: 0.7rem;
  color: var(--text-muted);
}
/* ---------- Mobile Overlay ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: 49;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.sidebar-overlay.active {
  opacity: 1;
}
/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: toastSlideIn 0.4s var(--transition-spring);
  max-width: 360px;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.toast--success {
  border-color: rgba(0, 230, 118, 0.3);
}
.toast--error {
  border-color: rgba(255, 82, 82, 0.3);
}
.toast--info {
  border-color: rgba(0, 212, 255, 0.3);
}
.toast__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.toast--success .toast__icon {
  color: #00e676;
}
.toast--error .toast__icon {
  color: #ff5252;
}
.toast--info .toast__icon {
  color: var(--text-accent);
}
@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
/* ---------- Utility Animations ---------- */
@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--brand-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: var(--spacing-md);
  opacity: 0.3;
}
/* ---------- Particles (floating elements) ---------- */
.particle {
  position: fixed;
  width: 3px;
  height: 3px;
  background: rgba(0, 212, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(90vh) translateX(10px) scale(1);
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-10vh) translateX(-10px) scale(0.5);
    opacity: 0;
  }
}
/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */
/* Tablet */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 320px;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 400px;
  }
  .chat__messages {
    padding: var(--spacing-xl);
  }
}
/* Mobile */
@media (max-width: 768px) {
  .header {
    padding: 0 var(--spacing-md);
  }
  .header__menu-btn {
    display: flex;
  }
  .header__status {
    display: none;
  }
  .header__subtitle {
    display: none;
  }
  .header__title {
    font-size: 1.05rem;
  }
  /* Sidebar transforms to slide-over drawer */
  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 85vw;
    max-width: 360px;
    min-width: auto;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--transition-smooth);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-3d);
  }
  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }
  .sidebar-overlay.active {
    pointer-events: auto;
  }
  /* Chat area full width */
  .chat__messages {
    padding: var(--spacing-lg);
  }
  .chat__input-area {
    padding: var(--spacing-md);
  }
  .message {
    max-width: 92%;
  }
  .welcome-title {
    font-size: 1.3rem;
  }
  .welcome-subtitle {
    font-size: 0.88rem;
  }
  .welcome-icon {
    width: 72px;
    height: 72px;
  }
  .welcome-icon svg {
    width: 36px;
    height: 36px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
    gap: var(--spacing-md);
  }
  .feature-card {
    padding: var(--spacing-lg);
  }
  .chat__input-hint {
    display: none;
  }
}
/* Small Mobile */
@media (max-width: 480px) {
  .header__logo {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .header__title {
    font-size: 0.95rem;
  }
  .sidebar {
    width: 92vw;
  }
  .message__content {
    padding: var(--spacing-md);
    font-size: 0.85rem;
  }
  .message__avatar {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
  .chat__send-btn {
    width: 40px;
    height: 40px;
  }
}
/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .chat__welcome {
    padding: var(--spacing-lg);
  }
  .welcome-icon {
    width: 56px;
    height: 56px;
    margin-bottom: var(--spacing-md);
  }
  .welcome-icon svg {
    width: 28px;
    height: 28px;
  }
  .welcome-title {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
  }
  .welcome-subtitle {
    display: none;
  }
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* Print styles */
@media print {
  body::before,
  .grid-overlay,
  .bg-orb,
  .particle {
    display: none;
  }
  .sidebar {
    display: none;
  }
  .chat__input-area {
    display: none;
  }
}
