/* PriceHawk — Theme System
   CSS custom properties for Light/Dark themes.
   Default: Dark. Priority colors overridable at runtime from SystemConfig API. */

/* ============================================================
   DARK THEME (default)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg: #0a0a0a;
  --bg-elevated: #121212;
  --card: #171717;
  --card-hover: #1f1f1f;
  --border: #262626;
  --divider: #1f1f1f;

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --text-inverse: #0a0a0a;

  /* Accent / Brand */
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-muted: rgba(20, 184, 166, 0.12);

  /* Priority colors — overridable via SystemConfig API at runtime */
  --priority-p1: #ef4444;
  --priority-p2: #f97316;
  --priority-p3: #eab308;
  --priority-p4: #3b82f6;
  --priority-p5: #6b7280;

  /* Semantic */
  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.12);
  --warning: #eab308;
  --warning-muted: rgba(234, 179, 8, 0.12);
  --error: #ef4444;
  --error-muted: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-muted: rgba(59, 130, 246, 0.12);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* Sizing */
  --top-bar-height: 52px;
  --bottom-nav-height: 60px;
  --sidebar-width: 240px;
  --drawer-width: 280px;
  --max-content-width: 1200px;
  --modal-max-width: 520px;
  --modal-product-max-width: 60vw;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index layers */
  --z-sidebar: 100;
  --z-top-bar: 200;
  --z-bottom-nav: 200;
  --z-drawer-overlay: 300;
  --z-drawer: 310;
  --z-modal-backdrop: 400;
  --z-modal: 410;
  --z-toast: 500;
  --z-tooltip: 600;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --card: #f5f5f5;
  --card-hover: #eeeeee;
  --border: #e5e5e5;
  --divider: #f0f0f0;

  --text-primary: #0a0a0a;
  --text-secondary: #525252;
  --text-muted: #a3a3a3;
  --text-inverse: #ffffff;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-muted: rgba(13, 148, 136, 0.08);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
}

/* ============================================================
   SYSTEM PREFERENCE (when user theme is 'auto')
   ============================================================ */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg: #ffffff;
    --bg-elevated: #fafafa;
    --card: #f5f5f5;
    --card-hover: #eeeeee;
    --border: #e5e5e5;
    --divider: #f0f0f0;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --text-inverse: #ffffff;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-muted: rgba(13, 148, 136, 0.08);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
  }
}

/* ============================================================
   BASE ELEMENT STYLES
   ============================================================ */
body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg);
  transition: background var(--transition-base), color var(--transition-base);
}

/* Selection */
::selection {
  background: var(--accent-muted);
  color: var(--accent);
}

/* Scrollbar (WebKit) */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
