/**
 * Legacy Investing Show - Unified Design System
 * Version: 1.0.0
 * 
 * This design system provides consistent styling across all pages.
 * Import this file in the <head> of every HTML page BEFORE page-specific styles.
 */

/* ========================================
   1. CSS CUSTOM PROPERTIES (Variables)
   ======================================== */

:root {
  /* Brand Colors - Gold System */
  --gold: #c9a962;
  --gold-light: #e0c078;
  --gold-dark: #a68b4b;
  --gold-50: rgba(201, 169, 98, 0.05);
  --gold-100: rgba(201, 169, 98, 0.1);
  --gold-200: rgba(201, 169, 98, 0.2);
  --gold-300: rgba(201, 169, 98, 0.3);
  
  /* Copper Accent */
  --copper: #b87333;
  
  /* Background Colors */
  --bg-primary: #0a0a0b;
  --bg-secondary: #121214;
  --bg-tertiary: #1a1a1d;
  
  /* Text Colors */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  /* Semantic Colors */
  --success: #16a34a;
  --success-light: #34d399;
  --danger: #dc2626;
  --danger-light: #fb7185;
  --urgency: #f43f5e;
  
  /* Border & Shadow */
  --border-subtle: rgba(201, 169, 98, 0.1);
  --border-medium: rgba(201, 169, 98, 0.2);
  --border-strong: rgba(201, 169, 98, 0.3);
  
  /* Typography */
  --font-serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --font-sans: 'Sora', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(201, 169, 98, 0.15);
  --shadow-gold-lg: 0 0 40px rgba(201, 169, 98, 0.2);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   2. BASE STYLES & RESET
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. TYPOGRAPHY SYSTEM
   ======================================== */

/* Font Family Utilities */
.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
}

/* Body Text */
p {
  font-family: var(--font-sans);
  color: var(--text-secondary);
}

/* Section Labels (Mono Uppercase) */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
}

/* Text Gradient */
.text-gradient-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   4. LAYOUT UTILITIES
   ======================================== */

/* Container */
.container {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Section Spacing */
.section {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
}

.section-sm {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Editorial Grid (Asymmetric) */
.editorial-grid {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .editorial-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.editorial-grid-reverse {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .editorial-grid-reverse {
    grid-template-columns: 1fr 2fr;
  }
}

/* ========================================
   5. BUTTON COMPONENTS
   ======================================== */

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Primary CTA Button */
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--bg-primary);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  font-size: 1.125rem;
  box-shadow: var(--shadow-gold);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 169, 98, 0.4);
}

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

/* Button Shimmer Effect */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Large Button Variant */
.btn-lg {
  padding: var(--space-5) var(--space-10);
  font-size: 1.25rem;
}

/* Small Button Variant */
.btn-sm {
  padding: var(--space-3) var(--space-5);
  font-size: 0.875rem;
}

/* Secondary Button (Outline) */
.btn-secondary {
  background: transparent;
  color: var(--gold);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  border: 2px solid var(--gold-200);
  font-size: 1rem;
}

.btn-secondary:hover {
  background: var(--gold-100);
  border-color: var(--gold);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-3) var(--space-4);
}

.btn-ghost:hover {
  color: var(--gold);
}

/* ========================================
   6. CARD COMPONENTS
   ======================================== */

/* Base Card */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

/* Card with Left Accent Border */
.card-accent {
  border-left: 4px solid var(--gold);
}

.card-accent-danger {
  border-left: 4px solid var(--danger);
}

.card-accent-success {
  border-left: 4px solid var(--success);
}

/* Featured Card (VIP Style) */
.card-featured {
  background: linear-gradient(145deg, var(--gold-50) 0%, rgba(18, 18, 20, 0.8) 100%);
  border: 2px solid var(--border-medium);
  position: relative;
}

/* Card Glow Effect */
.card-glow:hover {
  box-shadow: var(--shadow-gold-lg);
}

/* Glassmorphism Card */
.card-glass {
  background: rgba(18, 18, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
}

/* ========================================
   7. BADGE COMPONENTS
   ======================================== */

/* Base Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}

/* Gold Badge */
.badge-gold {
  background: var(--gold-100);
  color: var(--gold);
  border: 1px solid var(--gold-200);
}

/* VIP Badge */
.badge-vip {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--bg-primary);
  font-weight: 700;
}

/* Urgency Badge */
.badge-urgency {
  background: rgba(244, 63, 94, 0.1);
  color: var(--urgency);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-urgency::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--urgency);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Guarantee Badge */
.badge-guarantee {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success-light);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

/* Live Badge */
.badge-live {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success-light);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   8. FORM COMPONENTS
   ======================================== */

/* Input Base */
.input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  transition: all var(--transition-base);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-100);
}

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c9a962' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 1.25rem;
  padding-right: var(--space-10);
}

/* ========================================
   9. NAVIGATION
   ======================================== */

/* Fixed Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-4) 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
}

/* ========================================
   10. COUNTDOWN TIMER
   ======================================== */

.countdown {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

.countdown-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  min-width: 80px;
  text-align: center;
}

@media (min-width: 640px) {
  .countdown-item {
    padding: var(--space-6);
    min-width: 100px;
  }
}

.countdown-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

@media (min-width: 640px) {
  .countdown-number {
    font-size: 3rem;
  }
}

.countdown-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

@media (min-width: 640px) {
  .countdown-label {
    font-size: 0.75rem;
  }
}

/* ========================================
   11. PROGRESS BAR
   ======================================== */

.progress-bar {
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  box-shadow: 0 0 10px rgba(201, 169, 98, 0.3);
}

/* ========================================
   12. FAQ ACCORDION
   ======================================== */

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  background: var(--bg-secondary);
  border: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-base);
}

.faq-question:hover {
  background: var(--bg-tertiary);
}

.faq-question:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-content {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   13. UTILITY CLASSES
   ======================================== */

/* Text Utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-success { color: var(--success-light); }
.text-urgency { color: var(--urgency); }

/* Background Utilities */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }

/* ========================================
   14. SPECIAL EFFECTS
   ======================================== */

/* Noise Texture Overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Ambient Glow */
.glow-gold {
  position: absolute;
  width: 400px;
  height: 400px;
  background: var(--gold);
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.15;
  pointer-events: none;
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Animation */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger.active > *:nth-child(1) { animation: staggerIn 0.6s 0.1s forwards; }
.stagger.active > *:nth-child(2) { animation: staggerIn 0.6s 0.2s forwards; }
.stagger.active > *:nth-child(3) { animation: staggerIn 0.6s 0.3s forwards; }
.stagger.active > *:nth-child(4) { animation: staggerIn 0.6s 0.4s forwards; }

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   15. KEYFRAME ANIMATIONS
   ======================================== */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ========================================
   16. ACCESSIBILITY
   ======================================== */

/* Focus Visible (Keyboard Navigation) */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--bg-primary);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 9999;
  transition: top 0.3s;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reveal,
  .stagger > * {
    opacity: 1;
    transform: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --text-secondary: #d4d4d8;
    --text-muted: #a1a1aa;
    --border-subtle: rgba(201, 169, 98, 0.3);
  }
}

/* ========================================
   17. RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 639px) {
  .hide-mobile { display: none !important; }
  .section { padding-top: var(--space-16); padding-bottom: var(--space-16); }
}

@media (min-width: 640px) {
  .show-mobile { display: none !important; }
}

/* ========================================
   18. CUSTOM SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) var(--bg-secondary);
}
