/**
 * SVGaze Design System - Variables
 *
 * Define all design tokens used throughout the application.
 * Supports both light and dark themes.
 */

:root {
  /* === Color Palette - Light Theme (Default) === */
  --primary: #0066ff;
  --primary-hover: #0052cc;
  --primary-light: #eef2ff;

  --bg: #f6f8fa;
  --bg-secondary: #ffffff;
  --card: #ffffff;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --border: #e6e9ef;
  --border-hover: #d1d5db;

  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #dc2626;
  --error-light: #fee2e2;

  --favorite-color: #fbbf24;

  /* === Logo === */
  --logo-bg: #f1f2f3;

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

  /* === Typography === */
  --font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.85rem;    /* 13.6px */
  --font-size-base: 0.9rem;   /* 14.4px */
  --font-size-md: 1rem;       /* 16px */
  --font-size-lg: 1.05rem;    /* 16.8px */
  --font-size-xl: 1.1rem;     /* 17.6px */
  --font-size-2xl: 1.25rem;   /* 20px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* === Border Radius === */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* === Shadows === */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-header: 0 1px 0 rgba(0, 0, 0, 0.03);

  /* === Z-Index Scale === */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 50;
  --z-modal-backdrop: 1000;
  --z-modal: 1010;
  --z-toast: 2000;

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

  /* === Layout === */
  --header-height: 60px;
  --max-content-width: 1400px;
  --grid-gap: var(--space-md);
  --grid-min-column-width: 160px;

  /* === Component Specific === */
  --button-padding-x: var(--space-md);
  --button-padding-y: var(--space-sm);
  --input-padding: var(--space-sm) 10px;
  --card-padding: var(--space-lg);
  --modal-max-width: 900px;
}

/* === Dark Theme === */
[data-theme="dark"] {
  /* Color overrides for dark mode */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #2d3748;

  --bg: #1d1f24;
  --bg-secondary: #25272c;
  --card: #2d2f34;

  --text-primary: #e4e5e7;
  --text-secondary: #b4b6ba;
  --text-muted: #86888c;

  --border: #3a3c42;
  --border-hover: #4a4c52;

  --success: #22c55e;
  --success-light: #1e3a2a;
  --warning: #f59e0b;
  --warning-light: #3a2e1a;
  --error: #ef4444;
  --error-light: #3a2222;

  --favorite-color: #fbbf24;

  /* Logo */
  --logo-bg: #191b1f;

  /* Shadows for dark mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --shadow-header: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* === Accessibility - Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }
}

/* === System Color Scheme Preference === */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* Apply dark theme if no explicit theme is set */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #2d3748;

    --bg: #1d1f24;
    --bg-secondary: #25272c;
    --card: #2d2f34;

    --text-primary: #e4e5e7;
    --text-secondary: #b4b6ba;
    --text-muted: #86888c;

    --border: #3a3c42;
    --border-hover: #4a4c52;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --shadow-header: 0 1px 0 rgba(0, 0, 0, 0.3);
  }
}
