/* DIRA Gents — design tokens
 * Every color, spacing value, radius, shadow, and font size in the app
 * traces back to a variable defined here. Both dark and light themes
 * are configured in one place.
 */

:root {
  /* ── Brand blue scale (Revolut/N26-inspired) ─────────────────────── */
  --brand-50:   #e6f0ff;
  --brand-100:  #b8d3ff;
  --brand-300:  #5a8eff;
  --brand-500:  #0066ff;
  --brand-600:  #0052d6;
  --brand-700:  #003fa3;
  --brand-grad: linear-gradient(135deg, #0066ff 0%, #3d8bff 100%);
  --brand-glow: 0 0 0 6px rgba(0, 102, 255, 0.16),
                0 8px 28px rgba(0, 102, 255, 0.32);

  /* ── Brand orange scale (secondary) ───────────────────────────────
   * Orange is blue's direct complementary on the colour wheel — using
   * it for "recognition / leadership / warmth" gives the palette a
   * second hero colour without fighting the primary blue. */
  --orange-50:   #fff1eb;
  --orange-300:  #ff8a5c;
  --orange-500:  #ff6b35;
  --orange-700:  #e0521c;
  --orange-grad: linear-gradient(135deg, #ff6b35 0%, #ff9152 100%);
  --orange-glow: 0 0 0 6px rgba(255, 107, 53, 0.16),
                 0 8px 28px rgba(255, 107, 53, 0.32);
  --orange-bg:   rgba(255, 107, 53, 0.14);
  --orange-bg2:  rgba(255, 107, 53, 0.08);

  /* ── Refined green scale (money / success) ─────────────────────────
   * Slightly deeper than the existing #4ade80 mint — feels more like
   * "this is money" than "this is a status badge". The brighter 300
   * variant is kept for highlights/light-mode use. */
  --green-500:  #22c55e;
  --green-300:  #4ade80;
  --green-700:  #16a34a;
  --green-grad: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  --green-glow: 0 0 0 6px rgba(34, 197, 94, 0.16),
                0 8px 28px rgba(34, 197, 94, 0.32);

  /* ── Core palette ────────────────────────────────────────────────── */
  /* --bg shifts from #05071a → #08091a — a touch warmer and slightly
   * less ultramarine. The other ink layers track the same shift. */
  --bg:          #08091a;
  --ink:         #0e1023;
  --ink-hi:      #161830;
  --card:        #0f1535;
  --card-hi:     #141a2e;
  --sidebar:     #0b0f28;
  --border:      #1c2654;
  --border-soft: #141c3f;
  --accent:      var(--brand-500);
  --accent-hi:   var(--brand-300);
  --accent-bg:   rgba(0, 102, 255, 0.14);
  --accent-bg2:  rgba(0, 102, 255, 0.08);
  --navy:        #0b1b4d;
  --success:     #4ade80;
  --success-bg:  rgba(74, 222, 128, 0.14);
  --danger:      #ef4444;
  --gold:        #fbbf24;
  --gold-bg:     rgba(251, 191, 36, 0.14);
  --text:        #e8eaf6;
  --text-dim:    #a8b4cc;
  --muted:       #64748b;

  /* ── Glass surfaces (frosted backdrops) ─────────────────────────── */
  --glass:        rgba(255, 255, 255, 0.04);
  --glass-hi:     rgba(255, 255, 255, 0.07);
  --glass-stroke: rgba(255, 255, 255, 0.08);
  --glass-blur:   18px;

  /* ── Motion timing + easing ─────────────────────────────────────── */
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-slow: 380ms;
  --ease-out:    cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  /* ── Surface backgrounds (cards, rows, headers) ─────────────────── */
  --surface:     rgba(11, 15, 40, 0.55);
  --surface-hi:  rgba(15, 21, 53, 0.55);
  --surface-hover: rgba(15, 21, 53, 0.7);

  /* ── Text on dark backgrounds ───────────────────────────────────── */
  --text-on-dark:    rgba(232, 234, 246, 0.92);
  --text-on-dark-hi: rgba(232, 234, 246, 0.95);
  --text-on-dark-lo: rgba(232, 234, 246, 0.55);
  --text-on-dark-85: rgba(232, 234, 246, 0.85);
  --border-text:     rgba(232, 234, 246, 0.18);
  --border-text-hi:  rgba(232, 234, 246, 0.35);

  /* ── M-Pesa / green tones ───────────────────────────────────────── */
  /* --mpesa now aligns with the refined --green-500 (#22c55e) so M-Pesa
   * surfaces feel "money green" rather than mint. The lighter
   * --mpesa-text token stays bright for legibility on dark backgrounds. */
  --mpesa:           #22c55e;
  --mpesa-text:      #86efac;
  --mpesa-border:    rgba(34, 197, 94, 0.28);
  --mpesa-border-hi: rgba(34, 197, 94, 0.4);
  --mpesa-bg:        rgba(34, 197, 94, 0.12);
  --mpesa-bg-soft:   rgba(34, 197, 94, 0.08);
  --mpesa-bg-strong: rgba(34, 197, 94, 0.16);
  --mpesa-ring:      rgba(34, 197, 94, 0.25);

  /* ── STK Push specific ──────────────────────────────────────────── */
  --stk-green:       #43a047;
  --stk-green-dark:  #2e7d32;
  --stk-green-bg:    rgba(67, 160, 71, 0.15);
  --stk-green-ring:  rgba(67, 160, 71, 0.2);
  --stk-blue:        #1565c0;
  --stk-blue-dark:   #0d47a1;
  --stk-blue-bg:     rgba(21, 101, 192, 0.18);

  /* ── RSVP / poll status colors ──────────────────────────────────── */
  --rsvp-yes:        rgba(34, 197, 94, 0.55);
  --rsvp-yes-bg:     rgba(34, 197, 94, 0.16);
  --rsvp-yes-text:   #86efac;
  --rsvp-no:         rgba(239, 68, 68, 0.5);
  --rsvp-no-bg:      rgba(239, 68, 68, 0.12);
  --rsvp-no-text:    #fca5a5;
  --rsvp-maybe:      rgba(234, 179, 8, 0.5);
  --rsvp-maybe-bg:   rgba(234, 179, 8, 0.12);
  --rsvp-maybe-text: #fde047;

  /* ── Calendar event dot colors ──────────────────────────────────── */
  /* Birthday pills/dots now use orange so birthdays read as "warm /
   * recognition" while graduation events stay green ("achievement"). */
  --cal-bday-border: rgba(255, 107, 53, 0.45);
  --cal-bday-bg:     rgba(255, 107, 53, 0.12);
  --cal-bday-dot:    rgba(255, 107, 53, 0.95);
  --cal-grad-border: rgba(34, 197, 94, 0.38);
  --cal-grad-bg:     rgba(34, 197, 94, 0.12);
  --cal-grad-dot:    rgba(34, 197, 94, 0.95);

  /* ── Attendance marks ───────────────────────────────────────────── */
  --attend-apology:       rgba(100, 116, 139, 0.18);
  --attend-apology-border: rgba(100, 116, 139, 0.6);
  --attend-missed:        rgba(28, 38, 84, 0.55);
  --attend-missed-border: rgba(28, 38, 84, 1);

  /* ── Shadows ────────────────────────────────────────────────────── */
  --shadow:      0 18px 55px rgba(0,0,0,0.35);

  /* ── Radii ──────────────────────────────────────────────────────── */
  --radius-xl:   20px;
  --radius-lg:   14px;
  --radius-md:   10px;
  --radius:      10px;
  --radius-sm:   8px;
  --radius-pill: 999px;

  /* ── Spacing scale (4px base) ───────────────────────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;

  /* ── Typography scale ───────────────────────────────────────────── */
  --text-xs:  10px;
  --text-sm:  12px;
  --text-base: 13px;
  --text-md:  14px;
  --text-lg:  16px;
  --text-xl:  20px;
  --text-2xl: 26px;
}

/* ── Light theme ────────────────────────────────────────────────────── */
body.theme-light {
  --bg:          #f4f6fb;
  --ink:         #ffffff;
  --ink-hi:      #f7f9fd;
  --card:        #ffffff;
  --card-hi:     #f0f3fb;
  --sidebar:     #eef0f8;
  --border:      #d0d8ee;
  --border-soft: #dce3f2;
  --text:        #0b1220;
  --text-dim:    #3a4a6a;
  --muted:       #52607a;
  --shadow:      0 18px 55px rgba(4,8,20,0.10);

  /* Glass on light: tint with blue instead of white */
  --glass:        rgba(0, 102, 255, 0.04);
  --glass-hi:     rgba(0, 102, 255, 0.07);
  --glass-stroke: rgba(0, 102, 255, 0.12);

  /* Tone down the glow in light mode so it doesn't blow out */
  --brand-glow: 0 0 0 4px rgba(0, 102, 255, 0.12),
                0 8px 24px rgba(0, 102, 255, 0.18);

  /* ── Orange + green light-mode equivalents ─────────────────────────
   * On white, we shift the orange a touch deeper (#ea580c) so it stays
   * legible without going neon. The green also deepens for the same
   * reason — saturated mid-tones survive a white surround better
   * than near-fluorescent greens. Tinted backgrounds drop from 14%
   * (dark mode) to 12% alpha so light-mode tints don't get muddy. */
  --orange-500: #ea580c;
  --orange-300: #fb923c;
  --orange-grad: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
  --orange-bg:  rgba(234, 88, 12, 0.12);
  --orange-bg2: rgba(234, 88, 12, 0.06);
  --orange-glow: 0 0 0 4px rgba(234, 88, 12, 0.12),
                 0 8px 24px rgba(234, 88, 12, 0.18);

  --green-500: #16a34a;
  --green-300: #22c55e;
  --green-700: #15803d;
  --green-grad: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  --green-glow: 0 0 0 4px rgba(22, 163, 74, 0.12),
                0 8px 24px rgba(22, 163, 74, 0.18);

  /* Birthday pills follow the orange shift on light mode too. */
  --cal-bday-border: rgba(234, 88, 12, 0.40);
  --cal-bday-bg:     rgba(234, 88, 12, 0.10);
  --cal-bday-dot:    rgba(234, 88, 12, 0.95);

  /* Surfaces flip to light equivalents */
  --surface:     rgba(0, 0, 0, 0.02);
  --surface-hi:  rgba(0, 0, 0, 0.03);
  --surface-hover: rgba(0, 0, 0, 0.05);

  /* Text tokens for light mode */
  --text-on-dark:    var(--text);
  --text-on-dark-hi: var(--text);
  --text-on-dark-lo: var(--muted);
  --text-on-dark-85: var(--text);
  --border-text:     var(--border-soft);
  --border-text-hi:  var(--border);

  /* M-Pesa surfaces — pull from the deeper light-mode green so they
   * stay readable against white. The text token stays #166534 (very
   * dark green) for max contrast against the tinted background. */
  --mpesa:           #16a34a;
  --mpesa-text:      #166534;
  --rsvp-yes-text:   #166534;
  --rsvp-no-text:    #991b1b;
  --rsvp-maybe-text: #854d0e;

  /* STK Push badges */
  --stk-green-bg:    rgba(67, 160, 71, 0.12);
  --stk-blue-bg:     rgba(21, 101, 192, 0.12);
}
