/* ==========================================
   Multi-AI Browser - Web Version Styles
   Dark theme, responsive, single-page app
   ========================================== */

/* ---- CSS Custom Properties ---- */
:root {
  --bg-primary: #1e1e1e;
  --bg-secondary: #2d2d2d;
  --bg-card: #2d2d2d;
  --bg-card-hover: #3a3a3a;
  --bg-input: #1e1e1e;
  --border-color: #3d3d3d;
  --border-hover: #4d4d4d;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #6b7280;
  --accent-primary: #007aff;
  --accent-primary-hover: #0066d6;
  --accent-gradient: linear-gradient(135deg, #007aff 0%, #0066d6 50%, #3395ff 100%);
  --accent-blue: #667eea;
  --accent-green: #4CAF50;
  --accent-orange: #FF9800;
  --accent-red: #ef4444;
  --chatgpt-color: #10a37f;
  --claude-color: #cc785c;
  --grok-color: #1da1f2;
  --perplexity-color: #22c55e;
  --gemini-color: #8b5cf6;
  --tbd-color: #6b7280;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --font-sans: Verdana, Geneva, 'DejaVu Sans', sans-serif;
  --navbar-height: 42px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent-primary-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* ---- Page Sections ---- */
.page-section {
  display: none;
  padding-top: var(--navbar-height);
}

.page-section.active {
  display: block;
}

.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-container-sm {
  max-width: 700px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.section-title-sm {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  margin-top: 40px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.nav-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo {
  height: 26px;
  width: auto;
  border-radius: var(--radius-sm);
}

.nav-brand-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Logged-out auth buttons (inline) */
.nav-auth-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Settings dropdown wrapper */
.nav-settings-wrapper {
  position: fixed;
  top: 6px;
  right: 10px;
  z-index: 1001;
}

.nav-settings-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text-secondary);
  height: 28px;
  padding: 0 10px;
  gap: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.nav-settings-label {
  font-size: 12px;
  font-weight: 500;
}

.nav-settings-btn:hover,
.nav-settings-btn.open {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(0, 122, 255, 0.1);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 1001;
}

.nav-dropdown.open {
  display: block;
}

.nav-dropdown-user {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #7b9ec8;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
  text-decoration: none;
}

.nav-dropdown-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.nav-dropdown-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 18px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

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

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

/* Minimal Mode: hide badge and queries counter */
body.minimal-mode .input-bar-meta {
  display: none;
}

.nav-dropdown-logout {
  color: var(--accent-red);
}

.nav-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

/* Text Size Controls */
.text-size-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.text-size-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}

.text-size-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.text-size-btn-shrink { font-size: 11px; }
.text-size-btn-enlarge { font-size: 15px; }

.sync-scroll-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  padding: 0 8px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.15s;
}

.sync-scroll-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.sync-scroll-btn.active {
  background: rgba(0, 122, 255, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 14px;
  padding: 10px 20px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(0, 122, 255, 0.4);
}

.btn-primary-sm {
  background: var(--accent-gradient);
  color: white;
  font-size: 13px;
  padding: 7px 16px;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 14px;
  font-size: 13px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.btn-secondary {
  background: #6366f1;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
  background: #4f46e5;
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}

.btn-outline:hover {
  background: rgba(0, 122, 255, 0.1);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-logout {
  color: var(--accent-red);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

/* ==========================================
   HERO / LANDING
   ========================================== */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 20px;
  text-align: center;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -2px;
  margin-bottom: 12px;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.hero-preview {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  transition: transform 0.3s;
}

.hero-preview:hover {
  transform: translateY(-5px);
}

.preview-image {
  width: 100%;
  height: auto;
}

/* CTA shimmer */
.btn-primary.btn-lg {
  position: relative;
  overflow: hidden;
}

.btn-primary.btn-lg::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* ==========================================
   FEATURES
   ========================================== */
.features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: all 0.3s;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================
   HOW IT WORKS
   ========================================== */
.how-it-works {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.step-card {
  text-align: center;
  padding: 12px;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.step-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================
   PRICING
   ========================================== */
.pricing-preview, .pricing-options-lg {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px;
}

.pricing-options {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.pricing-options-lg {
  margin-top: 0;
}

.pricing-box {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  flex: 1;
  min-width: 240px;
  max-width: 300px;
  position: relative;
  transition: all 0.3s;
}

.pricing-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 122, 255, 0.15);
  border-color: var(--accent-primary);
}

.pricing-box.featured {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px rgba(0, 122, 255, 0.1);
}

.pricing-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--accent-green);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.plan-badge.best-value {
  background: var(--accent-orange);
}

.price {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.period {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
}

.features-list {
  list-style: none;
  margin-bottom: 14px;
}

.features-list li {
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.plan-select-btn {
  width: 100%;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s;
}

.plan-select-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ==========================================
   DASHBOARD - Full Viewport Layout
   ========================================== */
.dashboard-fullscreen {
  display: none;
  height: calc(100vh - var(--navbar-height));
  min-height: unset;
  overflow: hidden;
  padding-top: 0;
  margin-top: var(--navbar-height);
}

.dashboard-fullscreen.active {
  display: flex !important;
  flex-direction: column;
}

.dashboard-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 0;
  max-width: 100%;
}

/* Compact Input Bar */
.input-bar {
  display: flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  gap: 4px;
  flex-shrink: 0;
}

.input-bar-field {
  flex: 1;
  min-width: 200px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.input-bar-field:focus {
  border-color: var(--accent-primary);
}

.input-bar-field::-webkit-search-decoration,
.input-bar-field::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.input-bar-field::placeholder {
  color: var(--text-muted);
}

.input-bar-btn {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.input-bar-btn-primary {
  background: var(--accent-gradient);
  color: white;
}

.input-bar-btn-primary:hover {
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.input-bar-btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.input-bar-btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.input-bar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.queries-counter {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.subscription-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(102, 126, 234, 0.3);
  white-space: nowrap;
}

.subscription-badge.paid {
  background: rgba(76, 175, 80, 0.15);
  color: var(--accent-green);
  border-color: rgba(76, 175, 80, 0.3);
}

/* Collapsible Recent Prompts Drawer */
.recent-prompts-drawer {
  flex-shrink: 0;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.recent-prompts-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 2px 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color 0.2s;
}

.recent-prompts-toggle:hover {
  color: var(--text-primary);
}

.recent-prompts-toggle-icon {
  font-size: 9px;
  transition: transform 0.2s;
}

.recent-prompts-drawer.open .recent-prompts-toggle-icon {
  transform: rotate(180deg);
}

.recent-prompts-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.recent-prompts-drawer.open .recent-prompts-body {
  max-height: 180px;
  overflow-y: auto;
}

.recent-prompts-body::-webkit-scrollbar {
  width: 4px;
}

.recent-prompts-body::-webkit-scrollbar-track {
  background: transparent;
}

.recent-prompts-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.recent-prompts-body .prompt-history-list {
  border: none;
  border-radius: 0;
  background: transparent;
}

.recent-prompts-body .prompt-history-item {
  padding: 6px 12px;
  font-size: 12px;
}

.recent-prompts-body .prompt-history-text {
  font-size: 12px;
}

.recent-prompts-body .prompt-history-time {
  font-size: 10px;
}

.recent-prompts-body .empty-state {
  padding: 12px;
  font-size: 11px;
}

/* Chat Carousel Wrapper */
.chat-carousel-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-carousel-viewport {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

.chat-screen {
  display: none;
  width: 100%;
  height: 100%;
}

.chat-screen.active {
  display: grid;
}

/* Chat Panels Grid */
.chat-panels-grid {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  gap: 0;
  height: 100%;
}

/* Carousel Arrows */
.carousel-arrow {
  position: absolute;
  bottom: 38px;
  width: auto;
  padding: 0 8px;
  height: 22px;
  background: rgba(0, 122, 255, 0.15);
  border: 1px solid rgba(0, 122, 255, 0.3);
  border-radius: 4px;
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
  opacity: 0.7;
}

.carousel-arrow:hover {
  background: rgba(0, 122, 255, 0.3);
  border-color: var(--accent-primary);
  opacity: 1;
}

.carousel-arrow-left {
  left: 4px;
}

.carousel-arrow-right {
  right: 4px;
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 2px 0;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.carousel-dot.active {
  background: var(--accent-primary);
  transform: scale(1.3);
}

.chat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 2px solid var(--border-color);
  position: relative;
  min-height: 0;
}


.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.chat-panel-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.chat-panel-status {
  position: absolute;
  bottom: 4px;
  left: 8px;
  font-size: 10px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0.8;
}

.chat-panel-status.status-generating {
  color: var(--accent-primary);
  animation: statusPulse 1.2s ease-in-out infinite;
}

.chat-panel-status.status-done {
  color: var(--accent-green);
}

.chat-panel-status.status-error {
  color: var(--accent-red);
}

.chat-panel-status.status-cancelled {
  color: var(--text-muted);
}

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

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

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

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

.chat-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 40px 20px;
}

/* Chat Message Bubbles */
.chat-msg {
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-msg-user {
  align-self: flex-end;
}

.chat-msg-user .chat-msg-content {
  background: rgba(0, 122, 255, 0.15);
  border: 1px solid rgba(0, 122, 255, 0.25);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 10px 10px 2px 10px;
  font-size: var(--chat-font-size, 13px);
  line-height: 1.4;
}

.chat-msg-assistant {
  align-self: flex-start;
}

.chat-msg-assistant .chat-msg-content {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 10px 10px 10px 2px;
  font-size: var(--chat-font-size, 13px);
  line-height: 1.45;
  text-align: justify;
  white-space: pre-wrap;
}

.chat-msg-assistant .chat-msg-content ul,
.chat-msg-assistant .chat-msg-content ol {
  margin: 2px 0;
  padding-left: 18px;
  white-space: normal;
}

.chat-msg-assistant .chat-msg-content li {
  margin-bottom: 1px;
  text-align: left;
}

.chat-msg-assistant .chat-msg-content strong {
  color: #7b9ec8;
}

.chat-link {
  color: #7b9ec8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-link:hover {
  color: #a3c4e8;
}

.chat-inline-img {
  max-width: 100%;
  border-radius: 6px;
  margin: 4px 0;
}

.chat-msg-assistant .chat-msg-content .chat-heading {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 1px;
  margin: 3px 0 2px;
  white-space: normal;
}

/* Typing indicator for empty streaming message */
.chat-typing-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: typingBounce 0.8s ease-in-out infinite;
}

@keyframes typingBounce {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Vote Bar (Gemini / Perplexity panels) */
.vote-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-input);
  border-top: 1px solid var(--border-color);
  font-size: 11px;
}

.vote-label {
  color: var(--text-secondary);
  font-size: 11px;
  margin-right: 4px;
  white-space: nowrap;
}

.vote-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  line-height: 1;
  transition: all 0.2s;
}

.vote-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(0, 122, 255, 0.1);
}

.vote-btn.voted {
  border-color: var(--accent-primary);
  background: rgba(0, 122, 255, 0.15);
}

.vote-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 16px;
  text-align: center;
}

/* TBD Request Box */
.tbd-request-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px 16px;
  text-align: center;
  gap: 12px;
}

.tbd-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 220px;
}

.tbd-input {
  width: 100%;
  max-width: 200px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

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

.tbd-submit-btn {
  padding: 6px 20px;
  font-size: 12px;
}

.tbd-confirmation {
  font-size: 12px;
  color: var(--accent-primary);
  font-weight: 600;
}

/* Recent Prompts */
.prompt-history-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.prompt-history-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.prompt-history-item:last-child {
  border-bottom: none;
}

.prompt-history-item:hover {
  background: var(--bg-card-hover);
}

.prompt-history-text {
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.prompt-history-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ==========================================
   ACCOUNT
   ========================================== */
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.account-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.account-row:last-of-type {
  border-bottom: none;
}

.account-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.account-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.account-plan-message {
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0 4px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid currentColor;
  border-radius: 4px;
}

.account-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ==========================================
   MODALS
   ========================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.show, .modal[style*="display: flex"] {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
  border: 1px solid var(--border-color);
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.modal-header h2 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 13px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

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

.otp-input {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 8px;
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.primary-btn {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-sans);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  width: 100%;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.modal-footer-links {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 4px;
}

.modal-footer-links a {
  color: var(--accent-primary);
  font-weight: 500;
}

.modal-footer-links .separator {
  margin: 0 8px;
  color: var(--border-color);
}

/* Subscription Modal */
.subscription-modal .modal-content {
  max-width: 500px;
  text-align: center;
}

.subscription-content {
  padding: 40px 28px;
}

.subscription-content h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.modal-message {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

.lockout-timer {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.lockout-timer span {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-blue);
}

.lockout-info {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.payment-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.success-content {
  padding: 60px 40px;
}

.success-icon {
  font-size: 72px;
  color: var(--accent-green);
  margin-bottom: 16px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
  max-width: 380px;
}

.toast.success {
  border-color: var(--accent-green);
  background: rgba(76, 175, 80, 0.15);
  color: #a5d6a7;
}

.toast.error {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.toast.info {
  border-color: var(--accent-blue);
  background: rgba(102, 126, 234, 0.15);
  color: #93a4f4;
}

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100px);
    opacity: 0;
  }
}

/* ==========================================
   DOWNLOAD PAGE
   ========================================== */
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  transition: all 0.3s;
}

.download-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.12);
}

.download-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.download-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.download-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.download-btn {
  display: inline-block;
  text-decoration: none;
}

.download-benefits {
  margin-top: 32px;
}

.download-benefits-list {
  list-style: none;
  padding: 0;
}

.download-benefits-list li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.download-benefits-list li::before {
  content: '\2713\0020';
  color: var(--accent-primary);
  font-weight: 700;
  margin-right: 8px;
}

/* ==========================================
   CONTACT PAGE
   ========================================== */
.contact-about {
  margin-bottom: 32px;
}

.contact-about p,
.contact-info p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.contact-email-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
}

.contact-email-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-email-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.contact-email-link:hover {
  text-decoration: underline;
}

.contact-note {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  font-style: italic;
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
  padding: 8px 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 4px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

/* Hide footer when dashboard is showing */
body.dashboard-active .site-footer {
  display: none;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
  .features-grid, .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chat-panels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel-arrow {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {

  .hero-title {
    font-size: 34px;
    letter-spacing: -1px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .features-grid, .steps-grid, .download-grid {
    grid-template-columns: 1fr;
  }

  .chat-panels-grid {
    grid-template-columns: 1fr;
  }

  .input-bar {
    flex-wrap: wrap;
  }

  .input-bar-meta {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .pricing-options {
    flex-direction: column;
    align-items: center;
  }

  .pricing-box {
    max-width: 100%;
  }

  .page-container {
    padding: 24px 16px 60px;
  }

  .page-title {
    font-size: 26px;
  }

  .section-title {
    font-size: 22px;
  }

  .hero {
    padding: 40px 16px 24px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
  }

  .prompt-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }

  .price {
    font-size: 36px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: 100%;
  }

  .modal-content {
    margin: 10px;
  }
}
