/**
 * Bazyaft Visual Design Library — Design Tokens
 * Variables for Colors, Typography, Spacing, Elevation, and Transitions
 * Supports Light & Dark Modes and Persian RTL Typography
 */

:root {
  /* Brand Palette — Forest & Emerald Recycling Theme */
  --color-primary-50: #f0fdf4;
  --color-primary-100: #dcfce7;
  --color-primary-200: #bbf7d0;
  --color-primary-300: #86efac;
  --color-primary-400: #4ade80;
  --color-primary-500: #22c55e;
  --color-primary-600: #16a34a;
  --color-primary-700: #15803d; /* Primary Brand */
  --color-primary-800: #166534; /* Dark Accent */
  --color-primary-900: #14532d; /* Deep Forest */

  /* Secondary & Complementary Accents */
  --color-secondary-50: #ecfdf5;
  --color-secondary-500: #10b981; /* Emerald */
  --color-secondary-700: #047857;
  --color-amber-500: #f59e0b; /* Recycling Gold / Scrap Metal */
  --color-amber-600: #d97706;

  /* Neutral & Grayscale */
  --color-neutral-0: #ffffff;
  --color-neutral-50: #f8fafc;
  --color-neutral-100: #f1f5f9;
  --color-neutral-200: #e2e8f0;
  --color-neutral-300: #cbd5e1;
  --color-neutral-400: #94a3b8;
  --color-neutral-500: #64748b;
  --color-neutral-600: #475569;
  --color-neutral-700: #334155;
  --color-neutral-800: #1e293b;
  --color-neutral-900: #0f172a;

  /* Semantic Feedback & Status */
  --color-success-bg: #ecfdf5;
  --color-success-text: #065f46;
  --color-success-border: #a7f3d0;
  --color-success-base: #10b981;

  --color-warning-bg: #fffbeb;
  --color-warning-text: #92400e;
  --color-warning-border: #fde68a;
  --color-warning-base: #f59e0b;

  --color-danger-bg: #fef2f2;
  --color-danger-text: #991b1b;
  --color-danger-border: #fecaca;
  --color-danger-base: #ef4444;

  --color-info-bg: #eff6ff;
  --color-info-text: #1e40af;
  --color-info-border: #bfdbfe;
  --color-info-base: #3b82f6;

  /* Domain & Role Semantic Colors */
  --color-citizen: #10b981;    /* Emerald Green */
  --color-driver: #f59e0b;     /* Safety Amber / Logistics */
  --color-operations: #3b82f6; /* Command Blue */
  --color-warehouse: #8b5cf6;  /* Industrial Purple */
  --color-finance: #0d9488;    /* Currency Teal */
  --color-employees: #ec4899;  /* Team Rose */
  --color-organization: #6366f1; /* Enterprise Indigo */
  --color-admin: #0f172a;      /* Slate Black */

  /* App Surfaces & Backgrounds */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  /* Typography Scales (Optimized for Persian ascenders & descenders) */
  --font-family-fa: 'Vazirmatn', 'Shabnam', 'Tahoma', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'Consolas', 'Courier New', monospace;

  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Persian line-height requires larger ratios to avoid clipping diacritics */
  --line-height-tight: 1.35;
  --line-height-normal: 1.65;
  --line-height-loose: 1.9;

  /* Spacing Scale (8pt Grid) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* Border Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows & Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  /* Touch Target Ergonomics */
  --touch-target-min: 48px;
  --touch-target-driver: 60px; /* High ergonomics for glove use */

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index Hierarchy */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-drawer: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #111827;
  --bg-surface-subtle: #1f2937;
  --bg-surface-hover: #374151;
  --border-subtle: #1f2937;
  --border-strong: #374151;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;

  --color-primary-700: #22c55e;
  --color-primary-800: #4ade80;
  --color-primary-900: #86efac;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}
