/* ═══════════════════════════════════════════════════════════════
   StockSage — Complete Design System
   Palette: Deep Navy + Saffron Gold + Emerald + Platinum
   Typography: Bricolage Grotesque + Plus Jakarta Sans
═══════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  --navy-950: #020817;
  --navy-900: #0A0F1E;
  --navy-800: #0F172A;
  --navy-700: #111827;
  --navy-600: #1E293B;
  --navy-500: #334155;
  --navy-400: #475569;
  --navy-300: #64748B;

  --gold-500: #F59E0B;
  --gold-400: #FBBF24;
  --gold-300: #FCD34D;
  --gold-600: #D97706;

  --green-500: #10B981;
  --green-400: #34D399;
  --green-600: #059669;
  --green-glow: rgba(16, 185, 129, 0.15);

  --red-500: #EF4444;
  --red-400: #F87171;
  --red-600: #DC2626;
  --red-glow: rgba(239, 68, 68, 0.15);

  --orange-500: #F97316;
  --yellow-500: #EAB308;

  --platinum: #E8EDF5;
  --platinum-dim: #94A3B8;
  --white: #FFFFFF;

  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(245, 158, 11, 0.3);

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 30px rgba(245,158,11,0.15);
  --shadow-green: 0 0 30px rgba(16,185,129,0.15);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--navy-900);
  color: var(--platinum);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }
img { max-width: 100%; }

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-800); }
::-webkit-scrollbar-thumb { background: var(--navy-500); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

/* ─── TICKER TAPE ────────────────────────────────────────────── */
.ticker-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--navy-950);
  border-bottom: 1px solid var(--glass-border);
  height: 36px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ticker-status {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-right: 1px solid var(--glass-border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--platinum-dim);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red-500);
  animation: pulse-dot 2s infinite;
}
.status-dot.live { background: var(--green-500); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.ticker-track { flex: 1; overflow: hidden; position: relative; }
.ticker-inner {
  display: flex;
  gap: 0;
  animation: ticker-scroll 60s linear infinite;
  white-space: nowrap;
}
.ticker-inner:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 500;
  border-right: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition);
}
.ticker-item:hover { background: rgba(255,255,255,0.03); }
.ticker-symbol { color: var(--platinum); font-weight: 700; font-size: 11px; }
.ticker-price { color: var(--platinum-dim); }
.ticker-change.up { color: var(--green-500); }
.ticker-change.down { color: var(--red-500); }

/* ─── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 36px; left: 0; right: 0;
  z-index: 999;
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(2, 8, 23, 0.97);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--navy-900);
  box-shadow: 0 0 20px rgba(245,158,11,0.3);
}

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--white); }
.logo-sub { font-size: 9px; font-weight: 500; color: var(--platinum-dim); letter-spacing: 0.08em; text-transform: uppercase; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--platinum-dim);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}
.nav-link.active { color: var(--gold-400); }

.nav-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-400) !important;
  border: 1px solid rgba(245,158,11,0.2);
  background: rgba(245,158,11,0.06) !important;
}
.nav-ai:hover { background: rgba(245,158,11,0.12) !important; border-color: rgba(245,158,11,0.4); }

.ai-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  animation: pulse-dot 1.5s infinite;
}

.nav-search-mini {
  position: relative;
  width: 240px;
}
.nav-search-mini input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--platinum);
  outline: none;
  transition: var(--transition);
}
.nav-search-mini input:focus {
  border-color: rgba(245,158,11,0.4);
  background: rgba(255,255,255,0.07);
}
.nav-search-mini input::placeholder { color: var(--navy-300); }

.nav-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--navy-800);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: none;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.nav-search-results.show { display: block; }

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.hero-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  top: -100px; left: 50%;
  transform: translateX(-50%);
}
.hero-glow-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(16,185,129,0.12) 0%, transparent 70%);
  bottom: 0; left: 10%;
}
.hero-glow-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
  top: 20%; right: 5%;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-400);
  letter-spacing: 0.03em;
  margin-bottom: 28px;
  animation: fadeInDown 0.6s ease both;
}

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

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 80px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 24px;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero-title-accent {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 50%, #FF8C00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--platinum-dim);
  line-height: 1.7;
  margin-bottom: 48px;
  animation: fadeInUp 0.7s ease 0.2s both;
}

/* ─── HERO SEARCH ────────────────────────────────────────────── */
.hero-search-container {
  position: relative;
  max-width: 680px;
  margin: 0 auto 32px;
  animation: fadeInUp 0.7s ease 0.3s both;
}

.hero-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.hero-search-box:focus-within {
  border-color: rgba(245,158,11,0.5);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 4px rgba(245,158,11,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
}

.search-icon { color: var(--platinum-dim); flex-shrink: 0; }

.hero-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
}
.hero-search-input::placeholder { color: var(--navy-300); }

.search-kbd {
  flex-shrink: 0;
}
.search-kbd kbd {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--platinum-dim);
  font-family: var(--font-body);
}

.hero-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--navy-800);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: none;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
}
.hero-search-results.show { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--glass-border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(245,158,11,0.06); }

.search-result-symbol {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--gold-400);
  min-width: 80px;
}
.search-result-name { font-size: 13.5px; font-weight: 500; color: var(--platinum); flex: 1; }
.search-result-sector { font-size: 11px; color: var(--platinum-dim); }
.search-result-cap {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  color: var(--platinum-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.search-tag {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--platinum-dim);
  cursor: pointer;
  transition: var(--transition);
}
.search-tag:hover {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.3);
  color: var(--gold-400);
}

/* ─── HERO STATS ─────────────────────────────────────────────── */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  animation: fadeInUp 0.7s ease 0.4s both;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px 40px;
  max-width: 700px;
  margin: 0 auto;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 32px;
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-400);
}

.hero-stat-label {
  font-size: 11px;
  color: var(--platinum-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--glass-border);
}

/* ─── SECTIONS ───────────────────────────────────────────────── */
.section {
  padding: 80px 0;
}

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

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--platinum-dim);
  margin-top: 4px;
}

.ai-label-inline {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--navy-900);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

/* ─── MARKET OVERVIEW ────────────────────────────────────────── */
.market-overview {
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.market-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.status-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red-500);
}
.status-indicator.live { background: var(--green-500); animation: pulse-dot 1.5s infinite; }

.market-time {
  color: var(--platinum-dim);
  font-size: 12px;
  border-left: 1px solid var(--glass-border);
  padding-left: 8px;
  margin-left: 4px;
}

.indices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.index-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.index-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
  opacity: 0;
  transition: var(--transition);
}
.index-card:hover { border-color: var(--glass-border-hover); transform: translateY(-2px); }
.index-card:hover::before { opacity: 1; }

.index-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--platinum-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.index-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.index-change {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.index-change.up { color: var(--green-500); }
.index-change.down { color: var(--red-500); }

/* ─── MARKET BREADTH ─────────────────────────────────────────── */
.market-breadth {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
}

.breadth-card { text-align: center; min-width: 80px; }
.breadth-label { font-size: 11px; color: var(--platinum-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.breadth-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.breadth-value.advances { color: var(--green-500); }
.breadth-value.declines { color: var(--red-500); }

.breadth-bar-container { flex: 1; }
.breadth-bar {
  height: 8px;
  background: rgba(239,68,68,0.3);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 6px;
}
.breadth-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1s ease;
}
.advances-fill { background: linear-gradient(90deg, var(--green-600), var(--green-400)); }
.breadth-pct { font-size: 12px; color: var(--platinum-dim); text-align: center; }

/* ─── AI INSIGHTS ────────────────────────────────────────────── */
.ai-insights-section { background: var(--navy-900); }

.ai-insights-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}

.ai-insight-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.ai-insight-card:hover { border-color: rgba(245,158,11,0.2); transform: translateY(-2px); }
.ai-insight-card.featured {
  border-color: rgba(245,158,11,0.15);
  background: linear-gradient(135deg, rgba(245,158,11,0.04) 0%, var(--glass-bg) 100%);
}

.ai-insight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-icon {
  font-size: 24px;
  width: 44px; height: 44px;
  background: rgba(245,158,11,0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-insight-meta { display: flex; flex-direction: column; gap: 2px; }
.ai-insight-type { font-size: 13px; font-weight: 700; color: var(--gold-400); }
.ai-insight-time { font-size: 11px; color: var(--platinum-dim); }

.ai-insight-text { font-size: 13.5px; color: var(--platinum-dim); line-height: 1.7; margin-bottom: 14px; }

.ai-insight-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.insight-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  color: var(--platinum-dim);
  border: 1px solid rgba(255,255,255,0.08);
}
.insight-tag.positive { background: rgba(16,185,129,0.1); color: var(--green-400); border-color: rgba(16,185,129,0.2); }
.insight-tag.negative { background: rgba(239,68,68,0.1); color: var(--red-400); border-color: rgba(239,68,68,0.2); }

/* ─── CURATED TABS ───────────────────────────────────────────── */
.curated-section { background: var(--navy-800); }

.curated-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 6px;
  overflow-x: auto;
}

.curated-tab {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--platinum-dim);
  transition: var(--transition);
  white-space: nowrap;
}
.curated-tab:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.curated-tab.active {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.08));
  color: var(--gold-400);
  border: 1px solid rgba(245,158,11,0.2);
}

.curated-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ─── STOCK CARD ─────────────────────────────────────────────── */
.stock-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stock-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,158,11,0.03) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}
.stock-card:hover {
  border-color: rgba(245,158,11,0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}
.stock-card:hover::after { opacity: 1; }

.stock-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stock-card-symbol {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-400);
}

.stock-card-name {
  font-size: 12px;
  color: var(--platinum-dim);
  margin-top: 2px;
  line-height: 1.3;
}

.stock-card-cap {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cap-large { background: rgba(99,102,241,0.15); color: #818CF8; }
.cap-mid { background: rgba(16,185,129,0.15); color: var(--green-400); }
.cap-small { background: rgba(245,158,11,0.15); color: var(--gold-400); }
.cap-micro { background: rgba(249,115,22,0.15); color: #FB923C; }
.cap-sme { background: rgba(239,68,68,0.15); color: var(--red-400); }

.stock-card-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.stock-card-change {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}
.stock-card-change.up { color: var(--green-500); }
.stock-card-change.down { color: var(--red-500); }

.stock-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.metric-item { display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 10px; color: var(--platinum-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.metric-value { font-size: 13px; font-weight: 600; color: var(--platinum); }
.metric-value.good { color: var(--green-400); }
.metric-value.bad { color: var(--red-400); }
.metric-value.warn { color: var(--gold-400); }

.stock-card-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.rating-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rating-strong-buy { background: rgba(16,185,129,0.15); color: var(--green-400); border: 1px solid rgba(16,185,129,0.25); }
.rating-buy { background: rgba(34,197,94,0.12); color: #4ADE80; border: 1px solid rgba(34,197,94,0.2); }
.rating-hold { background: rgba(245,158,11,0.12); color: var(--gold-400); border: 1px solid rgba(245,158,11,0.2); }
.rating-overvalued { background: rgba(249,115,22,0.12); color: #FB923C; border: 1px solid rgba(249,115,22,0.2); }
.rating-high-risk { background: rgba(239,68,68,0.12); color: var(--red-400); border: 1px solid rgba(239,68,68,0.2); }
.rating-avoid { background: rgba(220,38,38,0.15); color: #F87171; border: 1px solid rgba(220,38,38,0.25); }

.view-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-400);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}
.view-btn:hover { gap: 8px; }

/* ─── SECTORS GRID ───────────────────────────────────────────── */
.sectors-section { background: var(--navy-900); }

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.sector-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.sector-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-gold);
}

.sector-icon { font-size: 32px; margin-bottom: 10px; }
.sector-name { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.sector-count { font-size: 12px; color: var(--platinum-dim); margin-bottom: 12px; }
.sector-perf {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  display: inline-block;
}
.sector-perf.up { background: rgba(16,185,129,0.12); color: var(--green-400); }
.sector-perf.down { background: rgba(239,68,68,0.12); color: var(--red-400); }

/* ─── STOCKS TABLE ───────────────────────────────────────────── */
.stocks-table-section { background: var(--navy-800); }

.table-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-filter {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--platinum);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.table-filter:focus { border-color: rgba(245,158,11,0.4); }
.table-filter option { background: var(--navy-800); }

.stocks-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.stocks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.stocks-table thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border);
}

.stocks-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--platinum-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.stocks-table th.sortable { cursor: pointer; user-select: none; }
.stocks-table th.sortable:hover { color: var(--gold-400); }
.sort-icon { opacity: 0.4; font-size: 10px; }

.stocks-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: var(--transition);
  cursor: pointer;
}
.stocks-table tbody tr:hover { background: rgba(245,158,11,0.04); }
.stocks-table tbody tr:last-child { border-bottom: none; }

.stocks-table td {
  padding: 14px 16px;
  white-space: nowrap;
}

.td-company { display: flex; flex-direction: column; gap: 2px; }
.td-symbol { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--gold-400); }
.td-name { font-size: 12px; color: var(--platinum-dim); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.td-exchange {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--platinum-dim);
  letter-spacing: 0.04em;
}

.td-price { font-family: var(--font-display); font-weight: 700; color: var(--white); }
.td-change { font-weight: 600; }
.td-change.up { color: var(--green-500); }
.td-change.down { color: var(--red-500); }

.td-cap-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--platinum-dim);
}

.pagination { display: flex; gap: 6px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--platinum-dim);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover, .page-btn.active {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.3);
  color: var(--gold-400);
}

/* ─── AI ASSISTANT ───────────────────────────────────────────── */
.ai-assistant-section { background: var(--navy-900); }

.ai-assistant-card {
  background: var(--glass-bg);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-gold);
}

.ai-assistant-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(245,158,11,0.06) 0%, transparent 100%);
  border-bottom: 1px solid var(--glass-border);
}

.ai-assistant-icon {
  font-size: 40px;
  width: 64px; height: 64px;
  background: rgba(245,158,11,0.1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-assistant-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.ai-assistant-subtitle { font-size: 14px; color: var(--platinum-dim); }

.ai-chat-area {
  padding: 24px 32px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-message { display: flex; gap: 12px; align-items: flex-start; }
.ai-message-user { flex-direction: row-reverse; }

.ai-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--navy-900);
  flex-shrink: 0;
}

.user-avatar {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
}

.ai-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--platinum);
  line-height: 1.7;
  max-width: 80%;
}

.ai-message-user .ai-bubble {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.15);
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-suggestion {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gold-400);
  cursor: pointer;
  transition: var(--transition);
}
.ai-suggestion:hover { background: rgba(245,158,11,0.15); }

.ai-input-area {
  display: flex;
  gap: 12px;
  padding: 20px 32px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.02);
}

.ai-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  font-size: 14px;
  color: var(--white);
  outline: none;
  transition: var(--transition);
}
.ai-input:focus { border-color: rgba(245,158,11,0.4); background: rgba(255,255,255,0.07); }
.ai-input::placeholder { color: var(--navy-300); }

.ai-send-btn {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
  transition: var(--transition);
  flex-shrink: 0;
}
.ai-send-btn:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(245,158,11,0.4); }

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--navy-950);
  border-top: 1px solid var(--glass-border);
  padding: 60px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.footer-desc {
  font-size: 13.5px;
  color: var(--platinum-dim);
  line-height: 1.7;
  margin-bottom: 16px;
}

.footer-disclaimer {
  font-size: 11.5px;
  color: var(--navy-300);
  line-height: 1.6;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.footer-links a {
  font-size: 13.5px;
  color: var(--platinum-dim);
  transition: var(--transition);
}
.footer-links a:hover { color: var(--gold-400); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
  font-size: 12px;
  color: var(--navy-300);
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-400);
  transition: var(--transition);
  white-space: nowrap;
}
.btn-outline:hover {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.5);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-900);
  transition: var(--transition);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245,158,11,0.3); }

/* ─── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ─── PRICE FLASH ────────────────────────────────────────────── */
.price-flash-up {
  animation: flashUp 0.5s ease;
}
.price-flash-down {
  animation: flashDown 0.5s ease;
}

@keyframes flashUp {
  0%, 100% { color: var(--white); }
  50% { color: var(--green-400); text-shadow: 0 0 12px rgba(16,185,129,0.6); }
}

@keyframes flashDown {
  0%, 100% { color: var(--white); }
  50% { color: var(--red-400); text-shadow: 0 0 12px rgba(239,68,68,0.6); }
}

/* ─── LOADING SPINNER ────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(245,158,11,0.2);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .ai-insights-grid { grid-template-columns: 1fr 1fr; }
  .ai-insights-grid .featured { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-title { font-size: 42px; }
  .hero-subtitle { font-size: 15px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; padding: 16px 24px; }
  .hero-stat-divider { display: none; }
  .ai-insights-grid { grid-template-columns: 1fr; }
  .indices-grid { grid-template-columns: repeat(2, 1fr); }
  .market-breadth { flex-direction: column; text-align: center; }
  .section-header { flex-direction: column; }
  .table-controls { flex-direction: column; }
}

@media (max-width: 600px) {
  .hero { padding: 120px 16px 60px; }
  .hero-title { font-size: 32px; }
  .hero-stats { display: none; }
  .container { padding: 0 16px; }
  .section { padding: 48px 0; }
  .curated-tabs { gap: 2px; }
  .curated-tab { padding: 8px 12px; font-size: 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .ai-assistant-header { flex-direction: column; text-align: center; }
  .ai-chat-area { padding: 16px; }
  .ai-input-area { padding: 16px; }
}

/* ─── UTILITY ────────────────────────────────────────────────── */
.text-green { color: var(--green-500); }
.text-red { color: var(--red-500); }
.text-gold { color: var(--gold-400); }
.text-dim { color: var(--platinum-dim); }
.text-white { color: var(--white); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }