/* ==========================================================================
   HVMPS Design Tokens
   Breakpoints (documented, used in media queries directly since custom
   properties cannot be interpolated into @media conditions):
   - mobile:  320px+
   - tablet:  768px+
   - laptop:  1024px+
   - desktop: 1280px+
   ========================================================================== */

:root {
  /* ---- Color: base palette ---- */
  --color-bg: #eef2f4;
  --color-surface: #ffffff;
  --color-surface-alt: #f6f9fa;
  --color-border: #dde4e8;

  --color-primary: #166b45;
  --color-primary-hover: #105437;
  --color-primary-contrast: #ffffff;
  --color-primary-soft: #e4f2ea;

  --color-secondary: #245f8d;
  --color-secondary-hover: #1b4d74;
  --color-secondary-contrast: #ffffff;
  --color-secondary-soft: #e5eef5;

  --color-text: #1f2d2b;
  --color-text-muted: #566866;
  --color-text-on-primary: #ffffff;

  --color-warning: #7a4b05;
  --color-warning-soft: #faf0dd;
  --color-danger: #9d2723;
  --color-danger-soft: #f8e3e2;
  --color-success: #166b45;
  --color-success-soft: #e4f2ea;

  --color-favorite: #d9767c;

  /* ---- Typography ---- */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
    "Segoe UI Emoji", sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.375rem;
  --font-size-xl: 1.75rem;
  --font-size-2xl: 2.25rem;
  --line-height-tight: 1.25;
  --line-height-base: 1.55;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* ---- Spacing (4px scale) ---- */
  --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-16: 64px;

  /* ---- Radius ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* ---- Shadow ---- */
  --shadow-sm: 0 1px 2px rgba(20, 30, 28, 0.06);
  --shadow-md: 0 4px 12px rgba(20, 30, 28, 0.08);
  --shadow-lg: 0 10px 28px rgba(20, 30, 28, 0.12);

  /* ---- Layout ---- */
  --container-max: 1200px;
  --sidebar-width: 232px;
  --header-height: 60px;
  --bottom-nav-height: 60px;

  /* ---- Transition ---- */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 320ms ease;

  /* ---- Z-index ---- */
  --z-header: 40;
  --z-drawer: 50;
  --z-modal: 60;
  --z-toast: 70;
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --color-bg: #12191b;
  --color-surface: #1a2325;
  --color-surface-alt: #202b2d;
  --color-border: #2c3739;

  --color-primary: #79d7a0;
  --color-primary-hover: #91e2b2;
  --color-primary-contrast: #10231b;
  --color-primary-soft: #1f322a;

  --color-secondary: #94c7ef;
  --color-secondary-hover: #7fb5e2;
  --color-secondary-soft: #1e2c37;

  --color-text: #e8eeee;
  --color-text-muted: #a3b3b1;

  --color-warning: #f1c47e;
  --color-warning-soft: #362c1c;
  --color-danger: #f19a96;
  --color-danger-soft: #3a2321;
  --color-success: #79d7a0;
  --color-success-soft: #1f322a;

  --color-favorite: #e28d92;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --color-bg: #12191b;
    --color-surface: #1a2325;
    --color-surface-alt: #202b2d;
    --color-border: #2c3739;

    --color-primary: #79d7a0;
    --color-primary-hover: #91e2b2;
    --color-primary-contrast: #10231b;
    --color-primary-soft: #1f322a;

    --color-secondary: #94c7ef;
    --color-secondary-hover: #7fb5e2;
    --color-secondary-soft: #1e2c37;

    --color-text: #e8eeee;
    --color-text-muted: #a3b3b1;

    --color-warning: #f1c47e;
    --color-warning-soft: #362c1c;
    --color-danger: #f19a96;
    --color-danger-soft: #3a2321;
    --color-success: #79d7a0;
    --color-success-soft: #1f322a;

    --color-favorite: #e28d92;
  }
}
