/*
 * Design Tokens - CSS Custom Properties
 *
 * This file defines all colors and design values used throughout the application.
 * Using CSS variables provides a single source of truth and makes it easy to
 * update the color scheme globally.
 *
 * Naming Convention: Tailwind-style
 * - Gray scale: --color-gray-{50-900}
 * - Primary (blue): --color-blue-{50-900}
 * - Event types: --event-type-{name}-{bg|text}
 * - Other colors as needed
 *
 * Usage:
 *   color: var(--color-gray-500);
 *   background-color: var(--color-blue-50);
 */

:root {
  /* ===== Gray Scale ===== */
  /* Used for text, borders, backgrounds throughout the UI */
  --color-gray-50: #f9fafb;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* ===== Primary Color (Blue) ===== */
  /* Used for links, buttons, focus states */
  --color-blue-50: #eff6ff;
  --color-blue-200: #bfdbfe;
  --color-blue-400: #60a5fa;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8;
  --color-blue-800: #1e40af;
  --color-blue-900: #1e3a8a;

  /* ===== Event Type Colors ===== */
  /* Live events - Dark Blue */
  --event-type-live-bg: #bfdbfe;      /* blue-200 */
  --event-type-live-text: #1e3a8a;    /* blue-900 */

  /* Virtual events - Magenta/Pink */
  --event-type-virtual-bg: #fce7f3;   /* pink-100 */
  --event-type-virtual-text: #9f1239; /* rose-800 */

  /* Webinar events - Green */
  --event-type-webinar-bg: #dcfce7;   /* green-100 */
  --event-type-webinar-text: #166534; /* green-800 */

  /* Meal events - Orange/Amber */
  --event-type-meal-bg: #fed7aa;      /* orange-200 */
  --event-type-meal-text: #9a3412;    /* orange-800 */

  /* ===== Semantic Colors ===== */
  /* Background colors */
  --color-bg-primary: #ffffff;        /* white */
  --color-bg-secondary: var(--color-gray-50);

  /* Text colors */
  --color-text-primary: var(--color-gray-900);
  --color-text-secondary: var(--color-gray-600);
  --color-text-muted: var(--color-gray-500);

  /* Interactive colors */
  --color-interactive-primary: var(--color-blue-500);
  --color-interactive-primary-hover: var(--color-blue-600);
  --color-interactive-focus: var(--color-blue-500);

  /* Legacy alias - used by SMTP campaign styles */
  --color-primary: var(--color-blue-500);

  /* Info/Help colors */
  --color-info-bg: var(--color-blue-50);
  --color-info-border: var(--color-blue-200);
  --color-info-icon: var(--color-blue-400);
  --color-info-text: var(--color-blue-800);

  /* Success colors — green */
  --color-success-bg: #dcfce7;       /* green-100 */
  --color-success-border: #86efac;   /* green-300 */
  --color-success-text: #166534;     /* green-800 */
  --color-success: #16a34a;          /* green-600 */

  /* Danger / destructive — red */
  --color-danger-bg: #fee2e2;        /* red-100 */
  --color-danger-border: #fca5a5;    /* red-300 */
  --color-danger-text: #991b1b;      /* red-800 */
  --color-danger: #dc2626;           /* red-600 */

  /* Hover wash — one-step-up from white */
  --color-bg-hover: var(--color-gray-50);

  /* ===== Status Colors ===== */
  /* Registration tracker status indicators */

  /* High Risk - Red (pill) */
  --status-high-risk-bg: #dc2626;       /* red-600 */
  --status-high-risk-text: #ffffff;

  /* Goal Met - Light Green (pill, lighter intensity for colorblind accessibility) */
  --status-goal-met-bg: #86efac;        /* green-300 - lighter for contrast with red */
  --status-goal-met-text: #166534;      /* green-800 */

  /* Medium Risk - Red text only */
  --status-medium-risk-text: #dc2626;   /* red-600 */

  /* Some Risk - Orange text only */
  --status-some-risk-text: #ea580c;     /* orange-600 */

  /* On Track - Blue text only */
  --status-on-track-text: #3b82f6;      /* blue-500 */

  /* Ahead - Blue pill (action item - remove from promo schedule) */
  --status-ahead-bg: #3b82f6;           /* blue-500 */
  --status-ahead-text: #ffffff;

  /* Early - Gray text only */
  --status-early-text: #6b7280;         /* gray-500 */

  /* No Goal - Purple text only */
  --status-no-goal-text: #9333ea;       /* purple-600 */

  /* No Data - Light gray text only */
  --status-no-data-text: #9ca3af;       /* gray-400 */

  /* ===== Design-system tokens (mirrored from new-design-system/design-system/tokens/design-tokens.css) =====
     Canonical source of truth is the design-system token file; mirrored here additively so the
     live asset pipeline resolves the design-system shell + component tokens. Existing tokens
     above are left untouched, so non-AM modules (SMTP, Registration Tracker, etc.) are unaffected. */

  /* Type (CL-14) */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', Menlo, Monaco, Consolas, monospace;

  /* Neutrals — Slate (CL-15) */
  --color-slate-50:  #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;

  /* Surfaces + borders + foreground (slate-based) */
  --surface:       var(--color-bg-primary);
  --surface-2:     var(--color-slate-100);
  --paper:         var(--color-bg-primary);
  --border:        var(--color-slate-200);
  --border-strong: var(--color-slate-300);
  --border-faint:  #eef2f6;
  --fg:        var(--color-slate-900);
  --fg-muted:  var(--color-slate-600);
  --fg-faint:  var(--color-slate-400);

  /* Warning — amber (tinted treatment) */
  --color-warning-bg:     #fef3c7;
  --color-warning-border: #fcd34d;
  --color-warning-text:   #92400e;

  /* Chip-set category colors (Vertical / Topic / Event) + chat rewrite tag */
  --chip-vertical-bg:     #f0f9ff;
  --chip-vertical-border: #bae6fd;
  --chip-vertical-text:   #0c4a6e;
  --chip-topic-bg:        #fff7ed;
  --chip-topic-border:    #fed7aa;
  --chip-topic-text:      #9a3412;
  --chip-event-bg:        #ecfdf5;
  --chip-event-border:    #a7f3d0;
  --chip-event-text:      #065f46;
  --chat-rewrite-tag-text: #be185d;

  /* Spacing scale (CL-17) — 4px base */
  --s-1: 2px;
  --s-2: 4px;
  --s-3: 6px;
  --s-4: 12px;
  --s-5: 16px;
  --s-6: 24px;
  --s-7: 48px;

  /* Radius scale (CL-18) */
  --r-input: 3px;
  --r-pill:  4px;
  --r-card:  4px;
  --r-modal: 6px;

  /* Shadow scale (CL-19) — subtle */
  --sh-card:  0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
  --sh-menu:  0 2px 6px rgba(15,23,42,0.08), 0 1px 3px rgba(15,23,42,0.04);
  --sh-modal: 0 8px 24px rgba(15,23,42,0.12), 0 4px 8px rgba(15,23,42,0.06);

  /* Motion (CL-21) */
  --t-fast: 100ms ease-out;

  /* Back-compat aliases for app code that predates the slate tokens */
  --color-border-light:   var(--border);
  --color-border-default: var(--border-strong);

  /* ===== AM 4-tint domain system — DROPPED (JC2 / wayfinding-deprecated) =====
     Legacy detail-page CSS still references --tint-50/100/200/300/800 (formerly flipped
     per-domain to rose/amber/teal/indigo by the .am-domain-* classes). The 4-tint wayfinding
     is removed: --tint-* is mapped once to neutral slate so every reference renders neutral
     module-wide in a single move. Each --tint-* reference is swapped for a direct design-system
     token as its page is re-skinned (Phase B/C/D); this shim is deleted once none remain. */
  --tint-50:  var(--color-slate-50);
  --tint-100: var(--color-slate-100);
  --tint-200: var(--color-slate-200);
  --tint-300: var(--color-slate-200);
  --tint-800: var(--color-slate-700);
}

/* ===== AM domain tint-flip classes REMOVED (JC2) =====
   The per-domain --tint-* flips (.am-domain-activity / creative / audience / sending →
   rose / amber / teal / indigo) are gone. --tint-* is now defined once, neutral, in :root
   above, so all four domains render identically neutral. The .am-domain-* class may still
   appear in markup and in creative_page.css scoped selectors; with no flip rule it is a
   harmless no-op until those references are cleaned up during the per-page re-skins. */
