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

:root {
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --bg-primary: #080d1a;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-glow: rgba(56, 189, 248, 0.15);
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
}

/* Light Theme Variables */
html.light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --border-glow: rgba(15, 23, 42, 0.08);
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

html.light .glass-card {
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.07);
}

.glass-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.12);
}

.glass-nav {
  background: rgba(8, 13, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html.light .glass-nav {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 20%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-emerald {
  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-gold {
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light .gradient-text {
  background: linear-gradient(135deg, #0f172a 20%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Background Gradients & Glow Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.18;
  z-index: 0;
}

.glow-emerald {
  background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 70%);
}

.glow-cyan {
  background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
}

.glow-purple {
  background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
}

/* Ticker Animation */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  animation: ticker-slide 32s linear infinite;
}

.ticker-wrap:hover .ticker-track {
  animation-play-state: paused;
}

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

/* Custom Range Slider */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 9999px;
  outline: none;
  transition: background 0.2s;
}

html.light input[type=range] {
  background: #e2e8f0;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  border: 3px solid #080d1a;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
  transition: transform 0.15s ease, background 0.2s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #34d399;
}

/* Grid Pattern Background */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

html.light .bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #080d1a;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Pulse badge */
.pulse-dot {
  position: relative;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Modal styles */
.modal-backdrop {
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Tab active state */
.tab-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border-color: #10b981;
  color: #ffffff;
}

html.light .tab-active {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

/* Risk Badges */
.badge-low-risk {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.badge-mid-risk {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #22d3ee;
}
.badge-high-risk {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* Coming Soon Badge */
.badge-coming-soon {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(217, 70, 239, 0.4);
  color: #f472b6;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Star Rating */
.star-filled {
  color: #f59e0b;
}

/* Quick Capital Preset Pill */
.capital-preset-btn {
  transition: all 0.2s ease;
}
.capital-preset-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
  font-weight: 700;
}


/* ==========================================================================
   THEME PALETTES OVERRIDES
   ========================================================================== */

/* 1. Midnight & Champagne Gold */
html.theme-gold {
  --bg-primary: #07090e;
  --bg-card: rgba(16, 20, 31, 0.85);
  --border-glow: rgba(245, 158, 11, 0.2);
}
html.theme-gold body {
  background-color: #07090e !important;
}
html.theme-gold .gradient-text-emerald {
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #d97706 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
html.theme-gold .bg-emerald-500 {
  background-color: #f59e0b !important;
  color: #080d1a !important;
}
html.theme-gold .text-emerald-400,
html.theme-gold .text-emerald-300 {
  color: #fbbf24 !important;
}
html.theme-gold .border-emerald-500,
html.theme-gold .border-emerald-500\/30,
html.theme-gold .border-emerald-500\/40 {
  border-color: rgba(245, 158, 11, 0.4) !important;
}
html.theme-gold .bg-emerald-500\/10,
html.theme-gold .bg-emerald-500\/20 {
  background-color: rgba(245, 158, 11, 0.12) !important;
}
html.theme-gold .from-emerald-500 {
  --tw-gradient-from: #f59e0b var(--tw-gradient-from-position) !important;
}
html.theme-gold .to-cyan-500 {
  --tw-gradient-to: #d97706 var(--tw-gradient-to-position) !important;
}
html.theme-gold .via-teal-500 {
  --tw-gradient-via: #eab308 var(--tw-gradient-via-position) !important;
}

/* 2. Swiss Minimalist Monochrome (Titanium & White) */
html.theme-monochrome {
  --bg-primary: #09090b;
  --bg-secondary: #121215;
  --bg-card: rgba(18, 18, 22, 0.88);
  --border-glow: rgba(255, 255, 255, 0.14);
}
html.theme-monochrome body {
  background-color: #09090b !important;
  color: #f4f4f5 !important;
}
html.theme-monochrome .glass-nav {
  background: rgba(9, 9, 11, 0.92) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
html.theme-monochrome .glass-card {
  background: rgba(18, 18, 22, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8) !important;
}
html.theme-monochrome .glass-card:hover {
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 25px 50px -12px rgba(255, 255, 255, 0.06) !important;
}
html.theme-monochrome .gradient-text-emerald {
  background: linear-gradient(135deg, #ffffff 0%, #e4e4e7 60%, #a1a1aa 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
html.theme-monochrome .bg-emerald-500 {
  background: #ffffff !important;
  color: #09090b !important;
  font-weight: 700 !important;
}
html.theme-monochrome .text-emerald-400,
html.theme-monochrome .text-emerald-300 {
  color: #f4f4f5 !important;
}
html.theme-monochrome .border-emerald-500,
html.theme-monochrome .border-emerald-500\/30,
html.theme-monochrome .border-emerald-500\/40 {
  border-color: rgba(255, 255, 255, 0.25) !important;
}
html.theme-monochrome .bg-emerald-500\/10,
html.theme-monochrome .bg-emerald-500\/20 {
  background-color: rgba(255, 255, 255, 0.08) !important;
}
html.theme-monochrome .from-emerald-500 {
  --tw-gradient-from: #ffffff var(--tw-gradient-from-position) !important;
}
html.theme-monochrome .to-cyan-500 {
  --tw-gradient-to: #71717a var(--tw-gradient-to-position) !important;
}
html.theme-monochrome .via-teal-500 {
  --tw-gradient-via: #d4d4d8 var(--tw-gradient-via-position) !important;
}
html.theme-monochrome input[type=range]::-webkit-slider-thumb {
  background: #ffffff !important;
  border: 3px solid #09090b !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8) !important;
}
html.theme-monochrome .capital-preset-btn.active {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}
html.theme-monochrome .glow-orb {
  opacity: 0.08 !important;
}
html.theme-monochrome .glow-emerald {
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0) 70%) !important;
}
html.theme-monochrome .glow-cyan {
  background: radial-gradient(circle, #a1a1aa 0%, rgba(161, 161, 170, 0) 70%) !important;
}

/* 3. Sapphire & Cobalt Blue (Institutional Wall Street) */
html.theme-sapphire {
  --bg-primary: #040916;
  --bg-card: rgba(10, 20, 45, 0.85);
  --border-glow: rgba(59, 130, 246, 0.2);
}
html.theme-sapphire body {
  background-color: #040916 !important;
}
html.theme-sapphire .gradient-text-emerald {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #06b6d4 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
html.theme-sapphire .bg-emerald-500 {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
}
html.theme-sapphire .text-emerald-400,
html.theme-sapphire .text-emerald-300 {
  color: #60a5fa !important;
}
html.theme-sapphire .border-emerald-500,
html.theme-sapphire .border-emerald-500\/30,
html.theme-sapphire .border-emerald-500\/40 {
  border-color: rgba(59, 130, 246, 0.4) !important;
}
html.theme-sapphire .bg-emerald-500\/10,
html.theme-sapphire .bg-emerald-500\/20 {
  background-color: rgba(59, 130, 246, 0.12) !important;
}
html.theme-sapphire .from-emerald-500 {
  --tw-gradient-from: #3b82f6 var(--tw-gradient-from-position) !important;
}
html.theme-sapphire .to-cyan-500 {
  --tw-gradient-to: #0284c7 var(--tw-gradient-to-position) !important;
}
html.theme-sapphire .via-teal-500 {
  --tw-gradient-via: #2563eb var(--tw-gradient-via-position) !important;
}

/* 4. Luxury White & Champagne Gold (Swiss Private Wealth) */
html.theme-white-gold,
html.theme-white-gold.dark {
  --bg-primary: #fcfcfd;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --border-glow: rgba(202, 138, 4, 0.22);
}
html.theme-white-gold body {
  background-color: #fbfbfd !important;
  color: #0f172a !important;
}
html.theme-white-gold .glass-nav {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid rgba(217, 119, 6, 0.18) !important;
}
html.theme-white-gold .glass-card {
  background: #ffffff !important;
  border: 1px solid rgba(217, 119, 6, 0.2) !important;
  box-shadow: 0 10px 30px -10px rgba(180, 83, 9, 0.08) !important;
}
html.theme-white-gold .glass-card:hover {
  border-color: rgba(217, 119, 6, 0.45) !important;
  box-shadow: 0 20px 40px -12px rgba(180, 83, 9, 0.14) !important;
}
html.theme-white-gold h1,
html.theme-white-gold h2,
html.theme-white-gold h3,
html.theme-white-gold .text-white {
  color: #0f172a !important;
}
html.theme-white-gold .text-slate-100,
html.theme-white-gold .text-slate-200,
html.theme-white-gold .text-slate-300 {
  color: #1e293b !important;
}
html.theme-white-gold .text-slate-400 {
  color: #475569 !important;
}
html.theme-white-gold .text-slate-500 {
  color: #64748b !important;
}
html.theme-white-gold .gradient-text-emerald {
  background: linear-gradient(135deg, #b45309 0%, #d97706 50%, #f59e0b 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
html.theme-white-gold .bg-emerald-500 {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
}
html.theme-white-gold .text-emerald-400,
html.theme-white-gold .text-emerald-300 {
  color: #b45309 !important;
}
html.theme-white-gold .border-emerald-500,
html.theme-white-gold .border-emerald-500\/30,
html.theme-white-gold .border-emerald-500\/40 {
  border-color: rgba(217, 119, 6, 0.35) !important;
}
html.theme-white-gold .bg-emerald-500\/10,
html.theme-white-gold .bg-emerald-500\/20 {
  background-color: rgba(245, 158, 11, 0.08) !important;
}
html.theme-white-gold .bg-\[\#050811\] {
  background-color: #fafaf9 !important;
  border-bottom: 1px solid rgba(217, 119, 6, 0.15) !important;
}
html.theme-white-gold .bg-\[\#070b16\],
html.theme-white-gold .bg-\[\#060a15\],
html.theme-white-gold .bg-\[\#080d1a\],
html.theme-white-gold .bg-\[\#04060d\] {
  background-color: #fbfbfd !important;
}
html.theme-white-gold .bg-slate-900,
html.theme-white-gold .bg-slate-900\/60,
html.theme-white-gold .bg-slate-900\/80,
html.theme-white-gold .bg-slate-900\/90,
html.theme-white-gold .bg-slate-950 {
  background-color: #f8fafc !important;
  border-color: rgba(217, 119, 6, 0.18) !important;
}
html.theme-white-gold .border-slate-800,
html.theme-white-gold .border-slate-800\/80,
html.theme-white-gold .border-slate-700,
html.theme-white-gold .border-slate-700\/80 {
  border-color: rgba(217, 119, 6, 0.15) !important;
}
html.theme-white-gold input[type=range] {
  background: #e2e8f0 !important;
}
html.theme-white-gold input[type=range]::-webkit-slider-thumb {
  background: #d97706 !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.5) !important;
}
html.theme-white-gold .glow-orb {
  display: none !important;
}
html.theme-white-gold .bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(217, 119, 6, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(217, 119, 6, 0.04) 1px, transparent 1px) !important;
}
