/**
 * Toolbox Design System - Theme Tokens
 * Modern dark theme with warm accents
 * © 2025 Jason Hoblin · bSundry Technologies
 */

:root {
  /* === Color Palette === */

  /* Primary Colors */
  --color-primary-50: #fef7ed;
  --color-primary-100: #fcebd4;
  --color-primary-200: #f9d4a8;
  --color-primary-300: #f5b471;
  --color-primary-400: #f08d38;
  --color-primary-500: #ec6d1a;
  --color-primary-600: #dd520f;
  --color-primary-700: #b73c0f;
  --color-primary-800: #923114;
  --color-primary-900: #762a13;

  /* Accent Colors */
  --color-accent-orange: #ff6b35;
  --color-accent-amber: #ffa500;
  --color-accent-gold: #ffd700;
  --color-accent-cyan: #00d9ff;
  --color-accent-green: #00ff88;

  /* Neutral Colors - Dark Theme */
  --color-neutral-50: #f8f9fa;
  --color-neutral-100: #e9ecef;
  --color-neutral-200: #dee2e6;
  --color-neutral-300: #ced4da;
  --color-neutral-400: #adb5bd;
  --color-neutral-500: #6c757d;
  --color-neutral-600: #495057;
  --color-neutral-700: #343a40;
  --color-neutral-800: #212529;
  --color-neutral-900: #0a0a0a;

  /* Background Colors */
  --color-bg-primary: #0f0d0b;
  --color-bg-secondary: #1a1410;
  --color-bg-tertiary: #2a1f18;
  --color-bg-elevated: #362a20;
  --color-bg-overlay: rgba(15, 13, 11, 0.95);

  /* Surface Colors */
  --color-surface-base: #1a1410;
  --color-surface-raised: #2a1f18;
  --color-surface-overlay: #362a20;
  --color-surface-hover: #453528;

  /* Text Colors */
  --color-text-primary: #fcebd4;
  --color-text-secondary: #d4c4b0;
  --color-text-tertiary: #a89580;
  --color-text-muted: #7a6f60;
  --color-text-inverse: #1a1410;

  /* Border Colors */
  --color-border-subtle: #362a20;
  --color-border-default: #453528;
  --color-border-strong: #5a4a38;
  --color-border-accent: var(--color-accent-orange);

  /* State Colors */
  --color-success: #00c896;
  --color-warning: #ffb800;
  --color-error: #ff4444;
  --color-info: #00a8ff;

  /* === Typography === */

  /* Font Families */
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  --font-family-display: 'Space Grotesk', var(--font-family-base);

  /* Font Sizes */
  --font-size-xs: 0.75rem;
  /* 12px */
  --font-size-sm: 0.875rem;
  /* 14px */
  --font-size-base: 1rem;
  /* 16px */
  --font-size-lg: 1.125rem;
  /* 18px */
  --font-size-xl: 1.25rem;
  /* 20px */
  --font-size-2xl: 1.5rem;
  /* 24px */
  --font-size-3xl: 1.875rem;
  /* 30px */
  --font-size-4xl: 2.25rem;
  /* 36px */
  --font-size-5xl: 3rem;
  /* 48px */

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

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* === Spacing === */

  --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 */

  /* === Border Radius === */

  --radius-sm: 0.25rem;
  /* 4px */
  --radius-md: 0.375rem;
  /* 6px */
  --radius-lg: 0.5rem;
  /* 8px */
  --radius-xl: 0.75rem;
  /* 12px */
  --radius-2xl: 1rem;
  /* 16px */
  --radius-full: 9999px;

  /* === Shadows === */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);

  /* === Transitions === */

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* === Z-Index Scale === */

  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-overlay: 1200;
  --z-modal: 1300;
  --z-popover: 1400;
  --z-tooltip: 1500;

  /* === Layout === */

  --sidebar-width: 220px;
  --sidebar-collapsed-width: 64px;
  --header-height: 64px;
  --content-max-width: 1440px;
}

/* === Light Theme Override (optional) === */
[data-theme="light"] {
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-tertiary: #e9ecef;
  --color-bg-elevated: #ffffff;

  --color-surface-base: #ffffff;
  --color-surface-raised: #f8f9fa;
  --color-surface-overlay: #ffffff;
  --color-surface-hover: #e9ecef;

  --color-text-primary: #212529;
  --color-text-secondary: #495057;
  --color-text-tertiary: #6c757d;
  --color-text-muted: #adb5bd;
  --color-text-inverse: #ffffff;

  --color-border-subtle: #dee2e6;
  --color-border-default: #ced4da;
  --color-border-strong: #adb5bd;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* === Base Styles === */

* {
  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-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
}

/* === Scrollbar Styling === */

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-orange);
}

/* === Selection === */

::selection {
  background-color: var(--color-accent-orange);
  color: var(--color-text-inverse);
}

/* === Focus Styles === */

:focus-visible {
  outline: 2px solid var(--color-accent-orange);
  outline-offset: 2px;
}