/**
 * NetShow Theme Overrides
 * MUST load AFTER all other CSS (including page CSS)
 * Forces theme variables to override page-level :root declarations
 * 
 * This file exists because legacy page CSS files set --ns-* vars in :root.
 * As those pages get upgraded, this file becomes unnecessary.
 */

/* ========================================
 * SILVER DARK — Override ALL page CSS
 * ======================================== */
html[data-ns-theme="silver"],
html[data-ns-theme="silver"][data-bs-theme="dark"] {
  --ns-bg-primary: #0f172a !important;
  --ns-bg-secondary: #1e293b !important;
  --ns-bg-tertiary: #334155 !important;
  --ns-bg-elevated: #3b4a63 !important;
  --ns-bg-surface: #1e293b !important;
  
  --ns-text-primary: #f1f5f9 !important;
  --ns-text-secondary: #94a3b8 !important;
  --ns-text-muted: #64748b !important;
  --ns-text-disabled: #475569 !important;
  
  --ns-accent: #94a3b8 !important;
  --ns-accent-hover: #cbd5e1 !important;
  --ns-accent-subtle: rgba(148, 163, 184, 0.1) !important;
  --ns-accent-text: #0f172a !important;
  --ns-accent-glow: rgba(148, 163, 184, 0.2) !important;
  
  --ns-highlight: #3b82f6 !important;
  --ns-highlight-hover: #2563eb !important;
  --ns-highlight-subtle: rgba(59, 130, 246, 0.1) !important;
  
  --ns-border: #334155 !important;
  --ns-border-subtle: #1e293b !important;
  --ns-border-strong: #475569 !important;
}

/* ========================================
 * SILVER LIGHT — Override ALL page CSS
 * ======================================== */
html[data-ns-theme="silver"][data-bs-theme="light"] {
  --ns-bg-primary: #f8fafc !important;
  --ns-bg-secondary: #ffffff !important;
  --ns-bg-tertiary: #f1f5f9 !important;
  --ns-bg-elevated: #f8fafc !important;
  --ns-bg-surface: #ffffff !important;
  
  --ns-text-primary: #0f172a !important;
  --ns-text-secondary: #475569 !important;
  --ns-text-muted: #94a3b8 !important;
  --ns-text-disabled: #cbd5e1 !important;
  
  --ns-accent: #64748b !important;
  --ns-accent-hover: #475569 !important;
  --ns-accent-subtle: rgba(100, 116, 139, 0.08) !important;
  --ns-accent-text: #ffffff !important;
  
  --ns-highlight: #2563eb !important;
  --ns-highlight-hover: #1d4ed8 !important;
  
  --ns-border: #e2e8f0 !important;
  --ns-border-subtle: #f1f5f9 !important;
  --ns-border-strong: #cbd5e1 !important;
}

/* ========================================
 * GOLD LIGHT — Override ALL page CSS
 * ======================================== */
html[data-ns-theme="gold"][data-bs-theme="light"],
html[data-bs-theme="light"]:not([data-ns-theme="silver"]) {
  --ns-bg-primary: #fafaf9 !important;
  --ns-bg-secondary: #ffffff !important;
  --ns-bg-tertiary: #f5f5f4 !important;
  --ns-bg-elevated: #fafaf9 !important;
  --ns-bg-surface: #ffffff !important;
  
  --ns-text-primary: #1c1917 !important;
  --ns-text-secondary: #57534e !important;
  --ns-text-muted: #a8a29e !important;
  --ns-text-disabled: #d6d3d1 !important;
  
  --ns-accent: #d97706 !important;
  --ns-accent-hover: #b45309 !important;
  --ns-accent-subtle: rgba(217, 119, 6, 0.08) !important;
  --ns-accent-text: #ffffff !important;
  
  --ns-border: #e7e5e4 !important;
  --ns-border-subtle: #f5f5f4 !important;
  --ns-border-strong: #d6d3d1 !important;
}

/* ========================================
 * S24 TOKEN AUTHORITY — neutralize legacy blue/purple BRAND tokens
 * (netshow-design-system.css) so brand chrome inherits the active
 * gold/silver theme accent instead of cold electric blue.
 *
 * Theme-aware: points the 8 brand-blue tokens at the resolved
 * --ns-accent / --ns-accent-hover / --ns-theme-gradient / --ns-accent-glow,
 * so ONE :root block stays correct in gold-dark (default), gold-light,
 * silver-dark and silver-light. Loads last → wins over the :root blue
 * definitions for every var() consumer. --primary/--ring are
 * var(--ns-accent-blue) aliases (propagate automatically); overridden
 * directly as belt-and-suspenders.
 *
 * Scope: token-driven surfaces only (~35 files: shell, home-page,
 * pricing, iq1 gallery, …). Per-surface HARDCODED hex (act-core.css,
 * pricing.css, agent-profile.css, footer-v2.css, live-stage.css, and the
 * inline blades) is a SEPARATE deferred restyle, not reachable by tokens.
 * Note: --ns-highlight (silver's intentional steel-blue interactive color)
 * and --ns-accent-green (success/live) are left untouched. The gold semantic
 * --ns-info and --ns-accent-cyan were de-blued at their SOURCE files in S25
 * (design-system.css --ns-info → steel #64748b; netshow-design-system.css
 * --ns-accent-cyan → ember #f97316), so no remap is needed here.
 * ======================================== */
:root {
  --ns-accent-blue:        var(--ns-accent, #f59e0b) !important;
  --ns-accent-purple:      var(--ns-accent-hover, #d97706) !important;
  --primary:               var(--ns-accent, #f59e0b) !important;
  --ring:                  var(--ns-accent, #f59e0b) !important;

  --ns-gradient-primary:   var(--ns-theme-gradient, linear-gradient(135deg, #f59e0b, #d97706)) !important;
  --ns-gradient-hero:      radial-gradient(ellipse 80% 60% at 50% -10%, var(--ns-accent-glow, rgba(245, 158, 11, 0.18)) 0%, transparent 70%) !important;
  --ns-gradient-card:      linear-gradient(135deg, var(--ns-accent-subtle, rgba(245, 158, 11, 0.08)) 0%, transparent 100%) !important;
  --ns-gradient-left:      linear-gradient(135deg, color-mix(in srgb, var(--ns-accent, #f59e0b) 22%, #000) 0%, #000 100%) !important;
  --ns-gradient-right:     linear-gradient(135deg, color-mix(in srgb, var(--ns-accent-hover, #d97706) 22%, #000) 0%, #000 100%) !important;

  --ns-blue-glow:          var(--ns-accent-glow, rgba(245, 158, 11, 0.25)) !important;
  --ns-purple-glow:        var(--ns-accent-glow, rgba(245, 158, 11, 0.22)) !important;
  --ns-blue-glow-strong:   var(--ns-accent-glow, rgba(245, 158, 11, 0.50)) !important;
  --ns-shadow-glow:        0 0 24px var(--ns-accent-glow, rgba(245, 158, 11, 0.35)) !important;
  --ns-shadow-glow-purple: 0 0 24px var(--ns-accent-glow, rgba(245, 158, 11, 0.30)) !important;
  --ns-shadow-glow-sm:     0 0 12px var(--ns-accent-glow, rgba(245, 158, 11, 0.20)) !important;

  --ns-border-blue:        color-mix(in srgb, var(--ns-accent, #f59e0b) 40%, transparent) !important;
  --ns-border-purple:      color-mix(in srgb, var(--ns-accent, #f59e0b) 35%, transparent) !important;
}

/* ========================================
 * S25 BOOTSTRAP PRIMARY DE-BLUE — the compiled app bundle ships Bootstrap's
 * DEFAULT blue primary (--bs-primary:#0d6efd, .btn-primary{--bs-btn-bg:#0d6efd})
 * used app-wide via .btn-primary / .btn-outline-primary / .bg-primary /
 * .text-primary / .border-primary / .text-bg-primary. A literal-hex grep
 * can't see these (class-based), so they were cold-blue islands on every
 * surface. Remap to the ACTIVE THEME accent via Bootstrap's own button vars
 * + the design-system --ns-accent / --ns-accent-hover / --ns-accent-text
 * tokens (theme-aware: gold in gold themes, steel in silver). Loads last →
 * wins over the bundle; NO Vite rebuild. Reversible.
 * ======================================== */
.btn-primary {
  --bs-btn-bg: var(--ns-accent, #f59e0b);
  --bs-btn-border-color: var(--ns-accent, #f59e0b);
  --bs-btn-color: var(--ns-accent-text, #000);
  --bs-btn-hover-bg: var(--ns-accent-hover, #d97706);
  --bs-btn-hover-border-color: var(--ns-accent-hover, #d97706);
  --bs-btn-hover-color: var(--ns-accent-text, #000);
  --bs-btn-active-bg: var(--ns-accent-hover, #d97706);
  --bs-btn-active-border-color: var(--ns-accent-hover, #d97706);
  --bs-btn-active-color: var(--ns-accent-text, #000);
  --bs-btn-disabled-bg: var(--ns-accent, #f59e0b);
  --bs-btn-disabled-border-color: var(--ns-accent, #f59e0b);
  --bs-btn-disabled-color: var(--ns-accent-text, #000);
}
.btn-outline-primary {
  --bs-btn-color: var(--ns-accent, #f59e0b);
  --bs-btn-border-color: var(--ns-accent, #f59e0b);
  --bs-btn-hover-bg: var(--ns-accent, #f59e0b);
  --bs-btn-hover-border-color: var(--ns-accent, #f59e0b);
  --bs-btn-hover-color: var(--ns-accent-text, #000);
  --bs-btn-active-bg: var(--ns-accent, #f59e0b);
  --bs-btn-active-border-color: var(--ns-accent, #f59e0b);
  --bs-btn-active-color: var(--ns-accent-text, #000);
}
.bg-primary { background-color: var(--ns-accent, #f59e0b) !important; }
.text-primary { color: var(--ns-accent, #f59e0b) !important; }
.border-primary { border-color: var(--ns-accent, #f59e0b) !important; }
.text-bg-primary {
  background-color: var(--ns-accent, #f59e0b) !important;
  color: var(--ns-accent-text, #000) !important;
}
