/**
 * BOMAtlas Design Tokens
 * Unified design system variables for brand consistency
 * Include before all other CSS files
 *
 * Philosophy: Bloomberg Terminal-inspired premium data intelligence
 * Primary: Gold #d4a012 | 8px spacing grid | Modular 1.25 scale
 */

:root {
  /* ===========================================
       COLOR SYSTEM
       Primary: Gold (Premium, Bloomberg-inspired)
       Secondary: Blue (accents, links)
       Elite: Amber (premium features, badges)
       =========================================== */

  /* Gold Scale - Full spectrum for flexibility */
  --gold-50: #fefce8;
  --gold-100: #fef9c3;
  --gold-200: #fef08a;
  --gold-300: #fde047;
  --gold-400: #facc15;
  --gold-500: #eab308;
  --gold-600: #d4a012;
  --gold-700: #b8860b;
  --gold-800: #92400e;
  --gold-900: #78350f;

  /* Primary Gold - Professional, enterprise feel */
  --color-primary: #d4a012;
  --color-primary-hover: #e8b71e;
  --color-primary-dark: #b8860b;
  --color-primary-light: #f4c430;
  --color-primary-alpha-10: rgba(212, 160, 18, 0.1);
  --color-primary-alpha-15: rgba(212, 160, 18, 0.15);
  --color-primary-alpha-20: rgba(212, 160, 18, 0.2);
  --color-primary-alpha-40: rgba(212, 160, 18, 0.4);

  /* Semantic Gold Applications */
  --color-primary-subtle: rgba(212, 160, 18, 0.08);
  --color-primary-muted: rgba(212, 160, 18, 0.15);
  --color-primary-glow: rgba(212, 160, 18, 0.4);

  /* Secondary Blue - Stronger saturation */
  --color-secondary: #4a9eff;
  --color-secondary-hover: #2080e0;
  --color-secondary-light: #7fb5ff;
  --color-secondary-alpha-10: rgba(74, 158, 255, 0.1);
  --color-secondary-alpha-20: rgba(74, 158, 255, 0.2);
  --color-secondary-alpha-40: rgba(74, 158, 255, 0.4);

  /* Elite Accent - For premium badges, verified status */
  --color-elite: #e8b71e;
  --color-elite-hover: #d4a41a;
  --color-elite-light: #f5d54a;

  /* Semantic Colors */
  --color-success: #22c55e;
  --color-success-hover: #16a34a;
  --color-warning: #f59e0b;
  --color-warning-hover: #d97706;
  --color-error: #ef4444;
  --color-error-hover: #dc2626;
  --color-info: #3b82f6;

  /* ===========================================
       BACKGROUNDS (Dark Theme)
       Layered scale from void to elevated
       =========================================== */
  /* Core background scale */
  --bg-void: #0a0c10;
  --bg-base: #0c0e12;
  --bg-surface: #12151a;
  --bg-elevated: #181c24;
  --bg-overlay-subtle: #1e232d;

  /* Legacy aliases (for compatibility) */
  --bg-primary: #0f1419;
  --bg-secondary: #15202b;
  --bg-tertiary: #192734;
  --bg-card: #1e2a38;
  --bg-hover: #22303c;
  --bg-surface-alpha: rgba(56, 68, 77, 0.3);
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --bg-modal: rgba(15, 20, 27, 0.95);

  /* ===========================================
       TEXT COLORS
       Note: --text-secondary updated from #8899a6 to #9ca3af
       for WCAG AA compliance (~5.5:1 contrast vs ~4.5:1)
       =========================================== */
  --text-primary: #e7e9ea;
  --text-secondary: #9ca3af;
  --text-muted: #6e767d;
  --text-disabled: #536471;
  --text-inverse: #0f1419;

  /* ===========================================
       BORDERS
       =========================================== */
  /* Border scale */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-gold: rgba(212, 160, 18, 0.3);
  --border-gold-strong: rgba(212, 160, 18, 0.5);

  /* Legacy aliases */
  --border-color: #38444d;
  --border-light: rgba(56, 68, 77, 0.5);
  --border-focus: var(--color-primary);
  --border-error: var(--color-error);

  /* ===========================================
       GRADIENTS
       =========================================== */
  --gradient-primary: linear-gradient(135deg, #b8860b 0%, #d4a012 50%, #e8b71e 100%);
  --gradient-secondary: linear-gradient(135deg, #2080e0 0%, #4a9eff 50%, #7fb5ff 100%);
  --gradient-dark: linear-gradient(135deg, #0a0e14 0%, #141820 100%);
  --gradient-card: linear-gradient(135deg, #141820 0%, #0a0e14 100%);
  --gradient-gold-subtle: linear-gradient(
    135deg,
    rgba(212, 160, 18, 0.05) 0%,
    rgba(212, 160, 18, 0.1) 100%
  );

  /* Premium Button Gradients */
  --gradient-btn-gold: linear-gradient(135deg, #b8860b 0%, #d4a012 35%, #e8b71e 70%, #d4a012 100%);
  --gradient-btn-gold-hover: linear-gradient(
    135deg,
    #d4a012 0%,
    #e8b71e 35%,
    #f4c430 70%,
    #e8b71e 100%
  );

  /* Hero Overlay Gradients */
  --gradient-hero-top: linear-gradient(180deg, rgba(12, 14, 18, 0.4) 0%, transparent 30%);
  --gradient-hero-center: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    transparent 0%,
    rgba(12, 14, 18, 0.3) 70%
  );
  --gradient-hero-bottom: linear-gradient(
    180deg,
    transparent 60%,
    rgba(12, 14, 18, 0.8) 80%,
    rgba(12, 14, 18, 1) 100%
  );

  /* ===========================================
       TYPOGRAPHY
       =========================================== */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

  /* Data display font - for stats, numbers, terminal-style elements */
  --font-data: var(--font-mono);

  /* Font Sizes - Base scale */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;
  --text-5xl: 48px;

  /* Display Typography - Hero headlines */
  --text-display-xl: clamp(56px, 8vw, 80px);
  --text-display-lg: clamp(40px, 6vw, 56px);
  --text-display-md: clamp(32px, 5vw, 44px);

  /* Data Typography - Stats, metrics */
  --text-data-xl: 56px;
  --text-data-lg: 48px;
  --text-data-md: 36px;
  --text-data-sm: 24px;

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Line Heights */
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.05em;

  /* ===========================================
       SPACING (8px Grid)
       =========================================== */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* ===========================================
       LAYOUT
       =========================================== */
  --sidebar-width: 380px;
  --sidebar-width-collapsed: 60px;
  --header-height: 60px;
  --footer-height: 48px;
  --max-content-width: 1200px;
  --max-form-width: 500px;

  /* ===========================================
       BORDER RADIUS
       =========================================== */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* ===========================================
       SHADOWS
       =========================================== */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.5);

  /* Gold Glow Shadows */
  --glow-gold-sm: 0 0 8px rgba(212, 160, 18, 0.3);
  --glow-gold-md: 0 0 16px rgba(212, 160, 18, 0.4);
  --glow-gold-lg: 0 0 24px rgba(212, 160, 18, 0.5);
  --shadow-glow: 0 0 20px var(--color-primary-alpha-40);
  --shadow-glow-secondary: 0 0 20px var(--color-secondary-alpha-20);

  /* Premium Button Shadows */
  --shadow-btn-primary: 0 4px 16px rgba(212, 160, 18, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-btn-primary-hover: 0 8px 24px rgba(212, 160, 18, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-btn-secondary: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-btn-secondary-hover: 0 4px 16px rgba(0, 0, 0, 0.3);

  /* ===========================================
       TRANSITIONS
       =========================================== */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-modal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Easing */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ===========================================
       Z-INDEX SCALE
       =========================================== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;

  /* ===========================================
       TOUCH TARGETS
       =========================================== */
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
}

/* ===========================================
   FOCUS STYLES (Accessibility)
   =========================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ===========================================
   SKELETON LOADING
   =========================================== */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-hover) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-card {
  height: 120px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
