/* ==========================================================================
   Conversational Research Partner — SaaS Design System & Stylesheet
   Theme: Deep Space Aurora Glassmorphism with Commercial SaaS Layer
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #070913;
  --bg-secondary: #0d1222;
  --bg-surface: rgba(18, 24, 43, 0.65);
  --bg-surface-elevated: rgba(26, 35, 64, 0.75);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  /* Accents & Gradients */
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-violet: #8b5cf6;
  --accent-fuchsia: #d946ef;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-gold: #fbbf24;

  --grad-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  --grad-aurora: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #8b5cf6 100%);
  --grad-studio: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #6366f1 100%);
  --grad-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #d97706 100%);
  --grad-glow: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(139, 92, 246, 0) 70%);

  /* Text Colors */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-accent: #38bdf8;

  /* Borders & Shadows */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(6, 182, 212, 0.5);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.25);
  --shadow-purple-glow: 0 0 25px rgba(139, 92, 246, 0.25);
  --shadow-gold-glow: 0 0 25px rgba(245, 158, 11, 0.35);

  /* Layout */
  --sidebar-width: 320px;
  --studio-width: 360px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Ambient Aurora Canvas Background --- */
.aurora-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
  top: -10%;
  left: 15%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
}

.orb-2 {
  bottom: -15%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
  animation-duration: 25s;
  animation-delay: -5s;
}

.orb-3 {
  top: 40%;
  left: 50%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 70%);
  opacity: 0.2;
  animation-duration: 30s;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* --- App Shell Container --- */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* --- Top Navigation Header --- */
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.brand-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--grad-aurora);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

.brand-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Video Tour Button */
.btn-video-tour {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
  font-weight: 600;
  animation: tourBtnPulse 3s infinite alternate;
}

@keyframes tourBtnPulse {
  0% { border-color: rgba(6, 182, 212, 0.4); box-shadow: 0 0 8px rgba(6, 182, 212, 0.2); }
  100% { border-color: var(--accent-cyan); box-shadow: 0 0 16px rgba(6, 182, 212, 0.45); }
}

.btn-video-tour:hover {
  background: rgba(6, 182, 212, 0.25);
  color: #fff;
}

.pulse-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #000;
  font-size: 9px;
  padding-left: 2px;
}

/* Upgrade Glow Button */
.btn-upgrade-glow {
  background: var(--grad-gold);
  border: none;
  color: #18181b;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-gold-glow);
  transition: all var(--transition-fast);
}

.btn-upgrade-glow:hover {
  transform: translateY(-1px) scale(1.04);
}

/* User Profile Widget */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-profile-widget:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

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

.user-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-tier-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.tier-free { color: var(--text-dim); }
.tier-pro { color: var(--accent-gold); text-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }

.badge-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.btn-icon {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--grad-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  opacity: 0.95;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* --- Main Layout Grid --- */
.main-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ==========================================================================
   LEFT SIDEBAR: Sources & Grounding Manager
   ========================================================================== */
.sources-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-smooth);
}

/* SaaS Usage Meter Card */
.usage-meter-card {
  margin: 14px 16px 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
}

.usage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.usage-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-text-link:hover { color: #fde047; }

.usage-bar-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.usage-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.progress-track {
  height: 5px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.sidebar-header {
  padding: 12px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.sources-count-badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
}

/* Ingestion Drop Zone */
.ingest-card {
  margin: 12px 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-glass);
  background: var(--bg-glass);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ingest-card:hover, .ingest-card.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: var(--shadow-glow);
}

.ingest-icon {
  font-size: 22px;
  margin-bottom: 4px;
  color: var(--accent-cyan);
}

.ingest-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.ingest-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Ingest Action Tabs */
.quick-input-tabs {
  display: flex;
  gap: 5px;
  padding: 0 16px 10px;
}

.tab-btn {
  flex: 1;
  padding: 5px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active, .tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-glass-hover);
  border-color: var(--accent-cyan);
}

.input-drawer {
  padding: 0 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-drawer input, .input-drawer textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
  font-family: inherit;
}

.input-drawer input:focus, .input-drawer textarea:focus { border-color: var(--accent-cyan); }

/* Source List */
.source-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all var(--transition-fast);
}

.source-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass);
}

.source-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.source-type-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.source-info { overflow: hidden; }

.source-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-details {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.source-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-source-action {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.btn-source-action:hover { color: var(--accent-rose); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ==========================================================================
   CENTER PANEL: Chat Conversation Stream
   ========================================================================== */
.chat-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.welcome-hero {
  margin: auto;
  max-width: 680px;
  text-align: center;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-violet);
  font-size: 0.8rem;
  font-weight: 600;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero-title span {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 520px;
}

/* Hero Video Banner */
.hero-video-banner {
  width: 100%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1.5px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.15);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hero-video-banner:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.3);
}

.video-banner-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.hero-video-banner h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 4px 0;
  color: #fff;
}

.hero-video-banner p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sample-prompts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.sample-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.sample-card:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.sample-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sample-card p {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Chat Messages */
.chat-message {
  display: flex;
  gap: 16px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { 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: 16px;
}

.avatar-user {
  background: var(--grad-aurora);
  color: #fff;
}

.avatar-assistant {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.message-body {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass);
  position: relative;
}

.chat-message.user .message-body {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sender-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.message-content {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-main);
}

.message-content p { margin-bottom: 12px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content h1, .message-content h2, .message-content h3 {
  font-family: 'Outfit', sans-serif;
  margin: 16px 0 8px;
  color: #fff;
}
.message-content ul, .message-content ol { margin: 8px 0 12px 20px; }
.message-content li { margin-bottom: 4px; }
.message-content code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent-cyan);
}
.message-content pre {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 12px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 12px 0;
}

/* Citations */
.citation-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  margin: 0 3px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
  cursor: pointer;
  vertical-align: baseline;
  transition: all var(--transition-fast);
}

.citation-chip:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 12px var(--accent-cyan);
  transform: scale(1.08);
}

.message-citations {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.citations-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.citation-pill {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.citation-pill:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.suggested-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-followup {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-followup:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-violet);
  color: #fff;
  transform: translateY(-1px);
}

.streaming-cursor::after {
  content: '▋';
  color: var(--accent-cyan);
  animation: blinkCursor 0.8s infinite;
  margin-left: 2px;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chat-input-area {
  padding: 16px 32px 24px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}

.input-box-wrapper {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(20px);
  transition: border-color var(--transition-fast);
}

.input-box-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  resize: none;
  max-height: 140px;
  min-height: 24px;
  line-height: 1.5;
}

.chat-textarea::placeholder { color: var(--text-dim); }

.btn-send {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 18px var(--accent-cyan);
}

.btn-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   RIGHT PANEL: NotebookLM Studio & Audio Deep Dive
   ========================================================================== */
.studio-panel {
  width: var(--studio-width);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-smooth);
}

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

.studio-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--grad-studio);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.audio-studio-card {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-purple-glow);
  position: relative;
  overflow: hidden;
}

.audio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.audio-card-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.pro-lock-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--grad-gold);
  color: #000;
  box-shadow: var(--shadow-gold-glow);
}

.pro-tool-tag {
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--grad-gold);
  color: #000;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-top: 2px;
}

/* Audio Wave Visualizer */
.visualizer-container {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 12px 0;
}

.wave-bar {
  width: 4px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 4px;
  transition: height 0.1s ease;
}

.wave-bar.playing {
  animation: wavePulse 1.2s infinite ease-in-out alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; background: #38bdf8; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; background: #818cf8; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; background: #a78bfa; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; background: #c084fc; }
.wave-bar:nth-child(6) { animation-delay: 0.3s; background: #818cf8; }
.wave-bar:nth-child(7) { animation-delay: 0.1s; background: #38bdf8; }

@keyframes wavePulse {
  0% { height: 6px; }
  100% { height: 32px; }
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.btn-play-podcast {
  background: var(--grad-studio);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-play-podcast:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

.studio-tools-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-studio-tool {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
  position: relative;
}

.btn-studio-tool:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-violet);
  transform: translateY(-2px);
  box-shadow: var(--shadow-purple-glow);
}

.tool-icon { font-size: 20px; }

.studio-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.note-item:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-glass-hover);
}

.note-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.note-preview {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   🎬 MULTI-PERSONA VIDEO DEMO / TOUR MODAL
   ========================================================================== */
.video-tour-modal-card {
  max-width: 680px;
  width: 95%;
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 45px rgba(6, 182, 212, 0.2);
}

.video-persona-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.persona-tab-btn {
  flex: 1;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-align: center;
}

.persona-tab-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-main);
  border-color: var(--border-glass);
}

.persona-tab-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3);
}

.video-player-frame {
  background: url('presenter.jpg') center/cover no-repeat;
  border: 1.5px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.25);
}

.video-screen-mockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(7, 9, 19, 0.7) 0%, rgba(7, 9, 19, 0.9) 100%);
  backdrop-filter: blur(4px);
}

.tour-stage-animation {
  width: 100%;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-step {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.4s ease;
}

.tour-step.active {
  display: flex;
}

.tour-step-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.tour-step h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.tour-step p {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 440px;
}

.tour-indicators {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-dot.active {
  width: 24px;
  border-radius: var(--radius-full);
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.tour-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tour-feature-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tour-feature-card span {
  font-size: 18px;
}

.tour-feature-card strong {
  display: block;
  font-size: 0.76rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.tour-feature-card p {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* ==========================================================================
   PRICING & UPGRADE MODAL
   ========================================================================== */
.pricing-modal-card {
  max-width: 680px;
  width: 95%;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.15);
}

.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.pricing-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.pricing-card.pro-tier-card {
  background: linear-gradient(160deg, rgba(30, 27, 75, 0.6), rgba(18, 24, 43, 0.9));
  border: 1.5px solid var(--accent-gold);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.pro-popular-tag {
  position: absolute;
  top: -10px;
  right: 18px;
  background: var(--grad-gold);
  color: #000;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.pricing-plan-header h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.price-tag {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
}

.price-tag span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-dim);
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 20px;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   MODALS & DRAWERS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active { display: flex; }

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  box-shadow: var(--shadow-glass);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.form-input:focus, .form-select:focus { border-color: var(--accent-cyan); }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   SCROLLBAR & UTILITIES
   ========================================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .studio-panel { display: none; }
}

@media (max-width: 768px) {
  .sources-sidebar { display: none; }
  .app-header { padding: 0 16px; }
  .chat-messages { padding: 16px; }
  .pricing-cards-grid { grid-template-columns: 1fr; }
  .tour-feature-grid { grid-template-columns: 1fr; }
}
