/* ============================================================================
   PM Pulse - Styles
   ============================================================================ */

/* Register CSS property for animation support */
@property --progress {
  syntax: '<number>';
  initial-value: 0;
  inherits: false;
}

:root {
  /* Colors - Dark theme with amber/gold accents */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: #15151f;
  
  --text-primary: #f0f0f5;
  --text-secondary: #9090a0;
  --text-muted: #606070;
  
  --accent-primary: #f7b84d;
  --accent-secondary: #ff6b35;
  --accent-glow: rgba(245, 166, 35, 0.3);
  
  --fear-color: #ef4444;
  --fear-bg: rgba(239, 68, 68, 0.15);
  --greed-color: #22c55e;
  --greed-bg: rgba(34, 197, 94, 0.15);
  --neutral-color: #eab308;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography */
  --font-display: 'Sora', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(245, 166, 35, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 107, 53, 0.05) 0%, transparent 40%);
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) 0;
  gap: var(--space-lg);
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Login Button */
.login-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.login-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.login-btn:active {
  transform: scale(0.98);
}

.google-icon {
  flex-shrink: 0;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  object-fit: cover;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: var(--fear-bg);
  border-color: var(--fear-color);
  color: var(--fear-color);
}

/* Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
}

.nav-link {
  padding: var(--space-sm) var(--space-lg);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent-primary);
  background: rgba(247, 184, 77, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  font-size: 2rem;
  color: var(--accent-primary);
  text-shadow: 0 0 20px var(--accent-glow);
}

.logo h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: var(--space-2xl);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  animation: spin 1s linear infinite;
}

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

.loading p {
  color: var(--text-secondary);
}

/* Error */
.error {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--fear-color);
}

.error-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.error p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Warnings */
.warnings {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  color: #eab308;
  font-size: 0.9rem;
}

/* Gauge Section */
.gauge-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

/* Removed: top color bar on gauge section */

.gauge-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.gauge-container {
  text-align: center;
  padding: var(--space-lg) 0;
  display: flex;
  justify-content: center;
}

.gauge-ring {
  position: relative;
  width: 220px;
  height: 220px;
}

/* Background arc (gray, 270 degrees) */
.gauge-arc-bg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 225deg,
    var(--bg-tertiary) 0deg,
    var(--bg-tertiary) 270deg,
    transparent 270deg
  );
  -webkit-mask: radial-gradient(circle, transparent 65%, black 65%, black 80%, transparent 80%);
  mask: radial-gradient(circle, transparent 65%, black 65%, black 80%, transparent 80%);
}

/* Value arc (gradient, reveals based on --progress) */
.gauge-arc {
  --progress: 50; /* 0-100, updated by JS */
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* Fixed gradient: red (left) -> yellow (top) -> green (right) */
  background: conic-gradient(
    from 225deg,
    #ef4444 0deg,
    #eab308 135deg,
    #22c55e 270deg,
    transparent 270deg
  );
  /* Ring mask: creates the donut shape */
  -webkit-mask: 
    radial-gradient(circle, transparent 65%, black 65%, black 80%, transparent 80%),
    conic-gradient(from 225deg, black 0deg, black calc(var(--progress) * 2.7deg), transparent calc(var(--progress) * 2.7deg));
  -webkit-mask-composite: source-in;
  mask: 
    radial-gradient(circle, transparent 65%, black 65%, black 80%, transparent 80%),
    conic-gradient(from 225deg, black 0deg, black calc(var(--progress) * 2.7deg), transparent calc(var(--progress) * 2.7deg));
  mask-composite: intersect;
  transition: --progress 0.8s ease-out;
}

.gauge-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge-value {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
  transition: color 0.5s ease;
}

.gauge-value.fear { 
  background: linear-gradient(180deg, var(--fear-color) 0%, #b91c1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.gauge-value.extreme-fear { 
  background: linear-gradient(180deg, #dc2626 0%, #7f1d1d 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.gauge-value.greed { 
  background: linear-gradient(180deg, var(--greed-color) 0%, #15803d 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.gauge-value.extreme-greed { 
  background: linear-gradient(180deg, #16a34a 0%, #14532d 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.gauge-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

.gauge-label.fear { color: var(--fear-color); }
.gauge-label.extreme-fear { color: #dc2626; }
.gauge-label.greed { color: var(--greed-color); }
.gauge-label.extreme-greed { color: #16a34a; }
.gauge-label.neutral { color: var(--neutral-color); }

.gauge-scale {
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.scale-item {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scale-item.fear { color: var(--fear-color); }
.scale-item.greed { color: var(--greed-color); }

/* Outlook Section */
.outlook-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-color);
}

.outlook-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.outlook-section .subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.outlook-bar-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  height: 32px;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.outlook-bar {
  --progress: 50; /* Updated by JS */
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--fear-color), var(--neutral-color), var(--greed-color));
  /* Key fix: background-size is calculated to keep gradient fixed relative to container */
  background-size: calc(10000% / var(--progress)) 100%;
  width: calc(var(--progress) * 1%);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              background-size 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.outlook-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
}

.outlook-value {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.outlook-factors {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.factor {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-secondary);
}

.factor-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.factor-value.positive {
  color: var(--greed-color);
}

.factor-value.negative {
  color: var(--fear-color);
}

/* Table Section */
.table-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border-color);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.table-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.table-wrapper {
  overflow: visible;
  margin: 0 calc(-1 * var(--space-xl));
  padding: 0 var(--space-xl);
}

.constituents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.constituents-table th,
.constituents-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.constituents-table th {
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.constituents-table td {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.constituents-table th:first-child,
.constituents-table td:first-child {
  font-family: var(--font-display);
  font-weight: 500;
  width: 45%; 
}

.constituents-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.constituents-table tbody tr:last-child td {
  border-bottom: none;
}

/* Direction badges */
.direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.direction.bullish {
  background: var(--greed-bg);
  color: var(--greed-color);
}

.direction.bearish {
  background: var(--fear-bg);
  color: var(--fear-color);
}

/* Category badge */
.category {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  color: var(--text-secondary);
}

/* Contribution colors */
.contribution {
  font-weight: 600;
}

.contribution.positive {
  color: var(--greed-color);
}

.contribution.negative {
  color: var(--fear-color);
}

.contribution.zero {
  color: var(--text-muted);
}

/* Error cell */
.error-cell {
  color: var(--fear-color);
  font-style: italic;
  font-family: var(--font-display);
}

/* Market links */
.market-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.market-link:hover {
  color: var(--accent-primary);
}

.market-link::after {
  content: '↗';
  font-size: 0.7em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.market-link:hover::after {
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.btn:hover {
  opacity: 1;
  background: transparent;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.85rem;
}

.btn-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
  transform: rotate(180deg);
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer p {
  margin-bottom: var(--space-xs);
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

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

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

.footer-links .separator {
  color: var(--text-muted);
}

.footer-links .powered-by {
  color: var(--text-muted);
}

/* ============================================================================
   Disclaimer Section (Main Page)
   ============================================================================ */

.disclaimer-section {
  margin-top: var(--space-xl);
}

.disclaimer-box {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.disclaimer-box h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #eab308;
  margin-bottom: var(--space-sm);
}

.disclaimer-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.disclaimer-box p:last-child {
  margin-bottom: 0;
}

.disclaimer-box strong {
  color: var(--text-primary);
}

.disclaimer-box .disclaimer-data {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.disclaimer-box ul {
  margin: var(--space-sm) 0;
  padding-left: var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.disclaimer-box li {
  margin-bottom: var(--space-xs);
}

/* ============================================================================
   Legal Pages (Privacy Policy, Terms of Service)
   ============================================================================ */

.legal-page {
  max-width: 800px;
}

.logo-link {
  text-decoration: none;
}

.legal-content {
  padding: var(--space-xl) 0;
}

.legal-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
  font-family: var(--font-mono);
}

.legal-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}

.legal-section:last-of-type {
  border-bottom: none;
}

.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: var(--space-lg) 0 var(--space-sm) 0;
}

.legal-section p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.legal-section ul {
  margin: var(--space-sm) 0 var(--space-md) 0;
  padding-left: var(--space-xl);
}

.legal-section li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xs);
}

.legal-section a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.legal-section a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Terms-specific disclaimer box */
.legal-section.disclaimer-section .disclaimer-box {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  margin: var(--space-md) 0;
}

.legal-section.disclaimer-section .disclaimer-box h3 {
  color: #ef4444;
  font-size: 1rem;
}

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

.contact-email a {
  color: var(--accent-primary);
  font-weight: 500;
}

.legal-footer {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-xl);
}

/* Responsive for legal pages */
@media (max-width: 640px) {
  .legal-title {
    font-size: 1.5rem;
  }
  
  .legal-section h2 {
    font-size: 1.1rem;
  }
  
  .legal-section p,
  .legal-section li {
    font-size: 0.9rem;
  }
}

/* Page containers */
.page {
  animation: fadeIn 0.3s ease;
}

/* Placeholder for upcoming pages */
.placeholder-page {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.placeholder-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: var(--space-lg);
}

.placeholder-page h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.placeholder-page p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============================================================================
   Leaderboard Teaser
   ============================================================================ */

.leaderboard-teaser {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Subtle background glow */
.leaderboard-teaser::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(247, 184, 77, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.teaser-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 4px 12px rgba(247, 184, 77, 0.3));
}

.leaderboard-teaser h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.teaser-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--space-xl);
}

/* Unlock Button (locked state) */
.teaser-cta {
  margin-bottom: var(--space-xl);
}

.unlock-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: none;
  border-radius: var(--radius-full);
  color: #0a0a0f;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(247, 184, 77, 0.3);
}

.unlock-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(247, 184, 77, 0.4);
}

.unlock-btn:active {
  transform: translateY(0);
}

.lock-icon {
  font-size: 1.1rem;
}

/* Success State (unlocked) */
.teaser-success {
  margin-bottom: var(--space-xl);
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  background: var(--greed-bg);
  border: 1px solid var(--greed-color);
  border-radius: var(--radius-full);
  color: var(--greed-color);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.check-icon {
  font-size: 1.2rem;
  font-weight: 700;
}

.notify-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Coming Soon Tag */
.coming-soon-tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Responsive */
@media (max-width: 640px) {
  .leaderboard-teaser {
    padding: var(--space-xl) var(--space-lg);
    min-height: 300px;
  }
  
  .teaser-icon {
    font-size: 3rem;
  }
  
  .leaderboard-teaser h2 {
    font-size: 1.5rem;
  }
  
  .unlock-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: var(--space-md);
  }
  
  /* Header responsive */
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  
  .header-left {
    width: 100%;
  }
  
  .header-right {
    width: 100%;
    justify-content: flex-end;
  }
  
  .user-name {
    display: none;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
  
  .gauge-value {
    font-size: 4rem;
  }
  
  .gauge-section,
  .outlook-section,
  .table-section {
    padding: var(--space-lg);
  }
  
  .table-wrapper {
    margin: 0 calc(-1 * var(--space-lg));
    padding: 0 var(--space-lg);
  }
  
  .outlook-factors {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  /* Nav responsive */
  .nav-bar {
    gap: var(--space-xs);
  }
  
  .nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.content > section {
  animation: fadeIn 0.5s ease forwards;
}

.content > section:nth-child(2) {
  animation-delay: 0.1s;
}

.content > section:nth-child(3) {
  animation-delay: 0.2s;
}

/* Event Markets Styles */
.event-header-row {
  background: var(--surface-2);
}

.event-header-row td {
  padding: var(--space-md) !important;
  border-bottom: 2px solid var(--accent);
}

.event-link {
  color: var(--accent-primary);
  text-decoration: none;
  margin-right: var(--space-sm);
  opacity: 0.8; 
}

.event-link:hover {
  color: var(--accent-primary);
  opacity: 1; 
}

.event-header-row .category {
  margin-right: 4px;
}

.event-header-row .volume {
  color: var(--text-muted);
  font-size: 0.55rem;
}

.outcome-cell {
  padding-left: var(--space-lg) !important;
  color: var(--text-muted);
}

.direction.neutral {
  color: var(--text-muted);
}

/* Tooltip Styles */
.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 50%;
  cursor: help;
  position: relative;
  vertical-align: middle;
}

.tooltip:hover {
  color: var(--text);
  background: var(--accent);
}

.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: rgba(30, 30, 40, 0.95);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 400;
  white-space: normal;
  max-width: 280px;
  text-align: left;
  color: var(--text);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip:hover::before {
  content: '';
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--border);
  z-index: 1001;
}

/* ============================================================================
   Geopolitics Map Styles
   ============================================================================ */

.geopolitics-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border-color);
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.geopolitics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.geopolitics-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
}

.geo-icon {
  font-size: 1.5rem;
}

/* Legend */
.geo-legend {
  display: flex;
  gap: var(--space-lg);
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-item.high .legend-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.legend-item.medium .legend-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.legend-item.low .legend-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* Map Container */
.geo-map {
  flex: 1;
  width: 100%;
  min-height: 400px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
}

/* Leaflet Overrides */
.leaflet-container {
  background: var(--bg-tertiary);
  font-family: var(--font-display);
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-tertiary) !important;
  color: var(--accent-primary) !important;
}

.leaflet-control-zoom-in {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
}

.leaflet-control-attribution {
  background: rgba(10, 10, 15, 0.8) !important;
  color: var(--text-muted) !important;
  font-size: 0.65rem !important;
}

.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

/* Marker Styles */
.geo-marker-container {
  background: transparent;
  border: none;
}

.geo-marker {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geo-marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 2;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.geo-marker:hover .geo-marker-dot {
  transform: scale(1.2);
}

.geo-marker.high .geo-marker-dot {
  background: #ef4444;
}

.geo-marker.medium .geo-marker-dot {
  background: #f59e0b;
}

.geo-marker.low .geo-marker-dot {
  background: #22c55e;
}

.geo-marker-pulse {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.4);
  animation: pulse 2s ease-out infinite;
  z-index: 1;
}

.geo-marker.high .geo-marker-pulse {
  background: rgba(239, 68, 68, 0.4);
}

.geo-marker.medium .geo-marker-pulse {
  background: rgba(245, 158, 11, 0.4);
}

.geo-marker.low .geo-marker-pulse {
  background: rgba(34, 197, 94, 0.4);
}

@keyframes pulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Popup Styles */
.geo-popup .leaflet-popup-content-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 0;
}

.geo-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

.geo-popup .leaflet-popup-tip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: none;
  border-left: none;
}

.geo-popup .leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 20px;
  padding: 8px 10px !important;
  width: auto !important;
  height: auto !important;
}

.geo-popup .leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
}

.popup-content {
  padding: var(--space-md);
  min-width: 260px;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.popup-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.popup-risk {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.popup-risk.high {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.popup-risk.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.popup-risk.low {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.popup-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-md) 0;
  line-height: 1.3;
}

/* Countries in popup */
.popup-countries {
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(247, 184, 77, 0.1);
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
}

/* Markets list in popup */
.popup-markets {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  gap: var(--space-sm);
}

.market-question {
  font-size: 0.7rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-prob {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.market-prob.high {
  color: #ef4444;
}

.market-prob.medium {
  color: #f59e0b;
}

.market-prob.low {
  color: var(--text-secondary);
}

/* Connection lines between countries */
.geo-connection-line {
  stroke-linecap: round;
}

/* Line popup */
.line-popup {
  text-align: center;
  padding: var(--space-xs);
}

.line-popup strong {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.line-popup span {
  color: var(--accent-primary);
  font-size: 0.85rem;
}

/* Timeline (legacy, keep for compatibility) */
.popup-timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.timeline-prob {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.timeline-prob.high {
  color: #ef4444;
}

.timeline-prob.medium {
  color: #f59e0b;
}

.timeline-prob.low {
  color: var(--text-secondary);
}

.popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
}

.popup-volume {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.popup-link {
  font-size: 0.8rem;
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.popup-link:hover {
  opacity: 0.8;
}

/* Stats Bar */
.geo-stats {
  display: flex;
  justify-content: space-around;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.geo-stat {
  text-align: center;
}

.geo-stat .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.geo-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================================
   Aggregated Marker Styles
   ============================================================================ */

/* Graph Node: Circle with degree number inside */
.geo-marker-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.geo-marker:hover .geo-marker-node {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.geo-marker.high .geo-marker-node {
  background: #ef4444;
}

.geo-marker.medium .geo-marker-node {
  background: #f59e0b;
}

.geo-marker.low .geo-marker-node {
  background: #22c55e;
}

/* Degree number inside node */
.geo-node-degree {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

/* Aggregated popup styles */
.popup-content.aggregated {
  max-height: 400px;
  overflow-y: auto;
}

.popup-header-agg {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.popup-node-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popup-country-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.popup-degree {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.popup-event-count {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.popup-event-item {
  padding: var(--space-sm) 0;
}

.popup-event-item.border-top {
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-sm);
}

.event-title-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.event-risk-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.event-risk-badge.high {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.event-risk-badge.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.event-risk-badge.low {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.event-title-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.event-title-link:hover {
  color: var(--accent-primary);
}

.event-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

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

.event-volume {
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

.event-markets {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: var(--space-xs);
  margin-top: var(--space-xs);
}

.market-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.75rem;
}

.market-mini:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.market-q {
  color: var(--text-secondary);
  flex: 1;
  margin-right: var(--space-xs);
}

.market-p {
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

.market-p.high {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.market-p.medium {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.market-p.low {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.popup-footer-total {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  text-align: right;
}

/* Connection line popup styles */
.line-popup {
  padding: var(--space-sm);
}

.line-popup .line-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-color);
}

.line-popup .line-event-count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
}

.line-popup .line-events-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-sm) 0;
}

.line-popup .line-events-list li {
  padding: 4px 0;
  font-size: 0.8rem;
}

.line-popup .line-events-list li:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.line-popup .line-events-list a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.line-popup .line-events-list a:hover {
  color: var(--accent-primary);
}

.line-popup .line-volume {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
  .geopolitics-section {
    padding: var(--space-md);
    min-height: 500px;
  }
  
  .geopolitics-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .geo-legend {
    width: 100%;
    justify-content: flex-start;
  }
  
  .geo-map {
    min-height: 350px;
  }
  
  .geo-stats {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  
  .geo-stat {
    flex: 1;
    min-width: 80px;
  }
  
  .popup-timeline {
    grid-template-columns: 1fr;
  }
}


