/* ============================================================================
   Palette — raw color tokens organized by family
   ----------------------------------------------------------------------------
   Mirrors agrodat/mobile/lib/uikit/theme/palette.dart.

   Color families are named for the natural/material they evoke (moss,
   wheat, stone, ink, frost, etc.) — one family per UI role. Semantic
   composition (which role maps to which color) lives in tokens.css,
   not here. Light and dark variants are exposed by overriding the same
   token names under [data-theme="dark"].

   Adding a new color:
     1. Pick a family name that matches the existing taxonomy, or add
        a new family if none of the existing ones fit.
     2. Declare the raw value under :root.
     3. If it's needed in dark mode, declare the dark value under
        [data-theme="dark"].
     4. Map it to a semantic role in tokens.css.
   ============================================================================ */

:root {
  /* ─── Moss (primary brand green) ─────────────────────────────────────────── */
  --color-moss: #4a7c59;
  --color-moss-light: #e8f3eb;
  --color-moss-dark: #2d5a3d;
  --color-moss-08: rgba(74, 124, 89, 0.08);
  --color-moss-10: rgba(74, 124, 89, 0.10);
  --color-moss-15: rgba(74, 124, 89, 0.15);
  --color-moss-18: rgba(74, 124, 89, 0.18);
  --color-moss-25: rgba(74, 124, 89, 0.25);

  /* ─── Wheat (secondary accent) ──────────────────────────────────────────── */
  --color-wheat: #c9a96e;
  --color-wheat-06: rgba(201, 169, 110, 0.06);

  /* ─── Stone (surface neutrals) ───────────────────────────────────────────── */
  --color-stone-50: #f6f5f2;
  --color-stone-100: #f0efe9;
  --color-stone-200: #eceae5;
  --color-stone-300: #e2e0da;

  /* ─── Ink (text) ─────────────────────────────────────────────────────────── */
  --color-ink: #1f2937;
  --color-ink-700: #6b7280;
  --color-ink-500: #9ca3af;

  /* ─── Status ─────────────────────────────────────────────────────────────── */
  --color-crimson: #dc2626;
  --color-crimson-10: rgba(220, 38, 38, 0.10);
  --color-crimson-15: rgba(220, 38, 38, 0.15);
  --color-crimson-light: #fef2f2;

  --color-forest: #16a34a;

  --color-amber: #d97706;
  --color-amber-70: rgba(217, 119, 6, 0.70);
  --color-amber-light: #fef3c7;

  /* ─── Frost (cool neutrals + pure white) ─────────────────────────────────── */
  --color-frost-50: #f3f4f6;
  --color-frost-300: #d1d5db;
  --color-frost-400: #9ca3af;
  --color-frost-700: #4b5563;
  --color-white: #ffffff;
  --color-white-on-primary: #ffffff;
  --color-surface: #ffffff;

  /* ─── METOS brand semantic ──────────────────────────────────────────────── */
  --color-metos: #0b866a;

  /* ─── Sensor domain pairs (raw bg + fg per sensor type) ──────────────────
     Each sensor type has a light-tinted background and a saturated foreground.
     Foregrounds stay readable in dark mode; backgrounds flip to a dark base. */
  --color-soil-temperature-bg: #fee2e2; --color-soil-temperature-fg: #b91c1c;
  --color-leaf-wetness-bg: #dbeafe;     --color-leaf-wetness-fg: #1d4ed8;
  --color-soil-moisture-bg: #fef3c7;    --color-soil-moisture-fg: #a16207;
  --color-rainfall-bg: #cffafe;         --color-rainfall-fg: #0e7490;
  --color-wind-speed-bg: #f3f4f6;       --color-wind-speed-fg: #4b5563;
  --color-eto-bg: #f3e8ff;             --color-eto-fg: #7e22ce;
  --color-ph-bg: #dcfce7;              --color-ph-fg: #15803d;
  --color-ec-bg: #ffedd5;              --color-ec-fg: #c2410c;
  --color-water-level-bg: #dbeafe;     --color-water-level-fg: #1e40af;
}

[data-theme="dark"] {
  /* ─── Moss — brighter in dark mode for AA contrast ──────────────────────── */
  --color-moss: #6ea679;
  --color-moss-light: #1f3a2a;
  --color-moss-dark: #4a7c59;
  --color-moss-08: rgba(110, 166, 121, 0.08);
  --color-moss-10: rgba(110, 166, 121, 0.10);
  --color-moss-15: rgba(110, 166, 121, 0.15);
  --color-moss-18: rgba(110, 166, 121, 0.18);
  --color-moss-25: rgba(110, 166, 121, 0.25);

  --color-wheat: #c9a96e;

  /* ─── Stone — dark surfaces ──────────────────────────────────────────────── */
  --color-stone-50: #0f1419;
  --color-stone-100: #232938;
  --color-stone-200: #232938;
  --color-stone-300: #2d3343;

  /* ─── Ink — light text on dark ──────────────────────────────────────────── */
  --color-ink: #e5e7eb;
  --color-ink-700: #9ca3af;
  --color-ink-500: #6b7280;

  /* ─── Status — dark variants ─────────────────────────────────────────────── */
  --color-crimson: #ef4444;
  --color-crimson-light: #3a1a1a;
  --color-forest: #22c55e;
  --color-amber: #f59e0b;
  --color-amber-light: #422006;

  /* ─── METOS — bright teal in dark mode, distinct from --forest ─────────── */
  --color-metos: #5eead4;

  /* ─── Surface — dark variant of the card / sidebar surface ────────────── */
  --color-surface: #1a1f2e;

  /* ─── Frost gray (dark variants — backs --neutral-bg / --neutral-fg) ──── */
  --color-frost-50: #1f2937;
  --color-frost-700: #d1d5db;

  /* ─── Sensor domain pairs (dark) — backgrounds flip to dark base ────────── */
  --color-soil-temperature-bg: #450a0a; --color-soil-temperature-fg: #fca5a5;
  --color-leaf-wetness-bg: #172554;     --color-leaf-wetness-fg: #93c5fd;
  --color-soil-moisture-bg: #422006;    --color-soil-moisture-fg: #fbbf24;
  --color-rainfall-bg: #083344;         --color-rainfall-fg: #67e8f9;
  --color-wind-speed-bg: #1f2937;       --color-wind-speed-fg: #9ca3af;
  --color-eto-bg: #2e1065;             --color-eto-fg: #c4b5fd;
  --color-ph-bg: #052e16;              --color-ph-fg: #4ade80;
  --color-ec-bg: #431407;              --color-ec-fg: #fdba74;
  --color-water-level-bg: #172554;     --color-water-level-fg: #93c5fd;
}
