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

:root {
  --bg-primary: #070a10;
  --bg-secondary: #0d1420;
  --bg-tertiary: #141e30;
  --bg-card: rgba(13, 20, 32, 0.90);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.25);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;
  
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  letter-spacing: -0.012em;
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

/* Glassmorphism Card System */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: 1.125rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-panel:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.6);
}

/* Financial Tabular Numbers */
.font-mono-num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* Tooltip System with Mobile Safety */
.has-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.has-tooltip .tooltip-box {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #0f172a;
  color: #f1f5f9;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
  width: max-content;
  max-width: 230px;
  z-index: 100;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.7);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  font-family: var(--font-sans);
  font-weight: 400;
}

@media (max-width: 640px) {
  .has-tooltip .tooltip-box {
    left: auto;
    right: 0;
    transform: translateY(4px);
    max-width: 200px;
  }
  .has-tooltip:hover .tooltip-box {
    transform: translateY(0);
  }
}

.has-tooltip:hover .tooltip-box {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: help;
  transition: all 0.15s ease;
  user-select: none;
}

.info-icon:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}
