/* Design Tokens - Theme Variables */

:root[data-theme="dark"] {
  /* Backgrounds */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #1a1a1a;
  --bg-card: rgba(26, 26, 26, 0.8);
  
  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-tertiary: #737373;
  
  /* Borders & Shadows */
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --shadow-sm: 0 2px 8px rgba(255, 255, 255, 0.03);
  --shadow-md: 0 4px 16px rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 8px 24px rgba(255, 255, 255, 0.08);
  
  /* Accent */
  --accent: #ffffff;
  --accent-dim: rgba(255, 255, 255, 0.7);
  
  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
}

:root[data-theme="light"] {
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;
  --bg-card: rgba(245, 245, 245, 0.8);
  
  /* Text */
  --text-primary: #000000;
  --text-secondary: #525252;
  --text-tertiary: #737373;
  
  /* Borders & Shadows */
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  
  /* Accent */
  --accent: #000000;
  --accent-dim: rgba(0, 0, 0, 0.7);
  
  /* Status Colors */
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --info: #2563eb;
}

/* Spacing Scale (8px base) */
:root {
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
}

/* Typography */
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  --text-6xl: 4rem;      /* 64px */
  
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
}

/* Border Radius */
:root {
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

/* Transitions */
:root {
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Z-Index Scale */
:root {
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Container Widths */
:root {
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1400px;
}

/* Responsive Breakpoints */
:root {
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1200px;
  --breakpoint-2xl: 1400px;
}

/* ===================================
   LIGHT THEME COLOR ENFORCEMENT
=================================== */

[data-theme="light"] {
  /* CRITICAL: Force background colors */
  --bg-primary: #ffffff !important;
  --bg-secondary: #f9fafb !important;
  --bg-tertiary: #f3f4f6 !important;
  --bg-card: rgba(255, 255, 255, 0.9) !important;

  /* CRITICAL: Force text colors */
  --text-primary: #111827 !important;
  --text-secondary: #4b5563 !important;
  --text-tertiary: #9ca3af !important;

  /* CRITICAL: Force border colors */
  --border: rgba(0, 0, 0, 0.12) !important;
  --border-hover: rgba(0, 0, 0, 0.24) !important;

  /* Accent colors */
  --accent: #2563eb !important;
  --accent-dim: rgba(37, 99, 235, 0.7) !important;

  /* Status colors (light mode versions) */
  --success: #16a34a !important;
  --warning: #ea580c !important;
  --error: #dc2626 !important;
  --info: #0284c7 !important;

  /* Shadows for light mode */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1) !important;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1) !important;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
}

/* Force body colors */
[data-theme="light"] body {
  background-color: #ffffff !important;
  color: #111827 !important;
}

/* Force section backgrounds */
[data-theme="light"] .apod-section,
[data-theme="light"] .featured-section,
[data-theme="light"] .news-section,
[data-theme="light"] .mars-rover-section {
  background-color: #ffffff !important;
}

[data-theme="light"] .stats-section,
[data-theme="light"] .exoplanet-section {
  background-color: #f9fafb !important;
}

/* Force card backgrounds */
[data-theme="light"] .data-card,
[data-theme="light"] .news-card,
[data-theme="light"] .mars-card,
[data-theme="light"] .exoplanet-card,
[data-theme="light"] .mission-card,
[data-theme="light"] .event-card,
[data-theme="light"] .apod-container,
[data-theme="light"] .skeleton-card {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

/* Force text colors in cards */
[data-theme="light"] .card-title,
[data-theme="light"] .news-card-title,
[data-theme="light"] .mars-card-title,
[data-theme="light"] .exoplanet-name,
[data-theme="light"] .mission-card-title,
[data-theme="light"] .event-card-title,
[data-theme="light"] .section-title,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #111827 !important;
}

[data-theme="light"] .card-content,
[data-theme="light"] .news-card-excerpt,
[data-theme="light"] .news-card-source,
[data-theme="light"] .data-label,
[data-theme="light"] .detail-label,
[data-theme="light"] .section-subtitle,
[data-theme="light"] p {
  color: #4b5563 !important;
}

/* Force footer colors */
[data-theme="light"] .footer {
  background: #f9fafb !important;
  border-top-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .footer-title {
  color: #111827 !important;
}

[data-theme="light"] .footer-text,
[data-theme="light"] .footer-links a,
[data-theme="light"] .footer-bottom p {
  color: #4b5563 !important;
}

/* Force navigation colors */
[data-theme="light"] .nav-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .nav-logo,
[data-theme="light"] .nav-link {
  color: #111827 !important;
}

[data-theme="light"] .nav-link:hover {
  color: #2563eb !important;
}

/* Force skeleton loader colors */
[data-theme="light"] .skeleton,
[data-theme="light"] .skeleton-image,
[data-theme="light"] .skeleton-text {
  background: linear-gradient(
    90deg,
    #f3f4f6 25%,
    #e5e7eb 50%,
    #f3f4f6 75%
  ) !important;
  background-size: 200% 100% !important;
}

/* Force hero section */
[data-theme="light"] .hero-section {
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%) !important;
}

[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #111827, #4b5563) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

[data-theme="light"] .hero-subtitle {
  color: #4b5563 !important;
}

/* Prevent grey flash on transition */
html[data-theme="light"].theme-transitioning {
  background-color: #ffffff !important;
}

html[data-theme="light"].theme-transitioning body {
  background-color: #ffffff !important;
}