/* Design tokens copied from panoramik-frontend/src/app/globals.css.
   Keep the two in sync: change a token there, then copy it here. */

/* ---------- Design tokens ---------- */
:root {
  --font-sans: var(--font-inter), system-ui, sans-serif;

  /* Font sizes (1rem = 16px at the browser default) */
  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.875rem; /* 14px */
  --text-md: 1rem; /* 16px */
  --text-lg: 1.25rem; /* 20px */
  --text-xl: 1.5rem; /* 24px */
  --text-xxl: 2rem; /* 28px */

  /* Font weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.5rem; /* 24px */
  --space-6: 2rem; /* 32px */
  --space-7: 2.5rem; /* 40px */
  --space-8: 3rem; /* 48px */

  /* Radius */
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.5rem; /* 8px */
  --radius-lg: 0.75rem; /* 12px */
  --radius-xl: 1.5rem; /* 24px */
  --radius-full: 9999px;
}

/* ---------- Colors: light-dark(light, dark) ---------- */
:root {
  color-scheme: light dark;

  --color-background: light-dark(#fdfdfd, #000);
  --color-background-gray: light-dark(#00000014, #18191ce0);
  --color-background-gray-hover: light-dark(#00000026, #b0c7d925);
  --color-background-accent: light-dark(#000, #fff);
  --color-background-accent-hover: light-dark(#2d2c2c, #f0f0f0);

  --color-text-heading: light-dark(#191919, #f0f0f0);
  --color-text: light-dark(#4d4d4d, #a1a4a5);
  --color-text-on-accent: light-dark(#fff, #000);

  --color-border: light-dark(#d7d7d7, #212629);

  --shadow-widget:
    0 1px 2px light-dark(rgb(0 0 0 / 0.06), rgb(0 0 0 / 0.4)),
    0 4px 12px light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.5));

  /* Chart colors */
  --color-positive: light-dark(#15803d, #4ade80);
  --color-negative: light-dark(#dc2626, #f87171);
  --chart-1: light-dark(#7c3aed, #a78bfa); /* AI */
  --chart-2: light-dark(#15803d, #4ade80); /* Organic */
  --chart-3: light-dark(#d97706, #fbbf24); /* Paid */
  --chart-grid: var(--color-border);
  --chart-axis: var(--color-text);

  /* AI model colors */
  --chart-chatgpt: light-dark(#0f766e, #2dd4bf);
  --chart-perplexity: light-dark(#2563eb, #60a5fa);
  --chart-gemini: light-dark(#7c3aed, #a78bfa);
  --chart-ai-overviews: light-dark(#db2777, #f472b6);
  --chart-claude: light-dark(#ea580c, #fb923c);

  /* Search Console metric colors */
  --chart-clicks: light-dark(#2563eb, #60a5fa);
  --chart-impressions: light-dark(#7c3aed, #a78bfa);

  /* Google Ads impression share colors */
  --chart-search-is: light-dark(#d97706, #fbbf24);
  --chart-top-is: light-dark(#0f766e, #2dd4bf);
  --chart-abs-top-is: light-dark(#db2777, #f472b6);

  /* Label: blue */
  --label-blue-text: light-dark(#1e40af, #93c5fd);
  --label-blue-border: light-dark(#1e40af, #1e3a8a);
  --label-blue-bg: light-dark(#dbeafe, #172554);

  /* Form fields */
  --color-field: light-dark(#f4f4f4, transparent);
  --color-field-focus: light-dark(#fff, transparent);
  --color-focus-ring: var(--color-background-gray);

  /* Icons in public/icons are drawn in black. light-dark() only works on
     colors, so the dark-mode flip is set with the theme rules below. */
  --icon-filter: none;
}

/* ---------- Manual toggle (for later) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --icon-filter: invert(1);
}

/* No data-theme set: follow the system setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --icon-filter: invert(1);
  }
}

.icon {
  filter: var(--icon-filter);
}

