/**
 * Yalla Arabic Design System - Tokens
 * Modern design tokens for 2025 UI/UX
 */

:root {
  /* ========================================
     COLOR SYSTEM - Light Mode (Default)
     ======================================== */
  
  /* Primary Brand Colors - Emerald to Turquoise Gradient */
  --yalla-emerald-50: #ecfdf5;
  --yalla-emerald-100: #d1fae5;
  --yalla-emerald-200: #a7f3d0;
  --yalla-emerald-300: #6ee7b7;
  --yalla-emerald-400: #34d399;
  --yalla-emerald-500: #10b981;
  --yalla-emerald-600: #059669;
  --yalla-emerald-700: #047857;
  
  --yalla-turquoise-50: #ecfeff;
  --yalla-turquoise-100: #cffafe;
  --yalla-turquoise-200: #a5f3fc;
  --yalla-turquoise-300: #67e8f9;
  --yalla-turquoise-400: #22d3ee;
  --yalla-turquoise-500: #06b6d4;
  --yalla-turquoise-600: #0891b2;
  --yalla-turquoise-700: #0e7490;
  
  /* Secondary Colors */
  --yalla-indigo-500: #6366f1;
  --yalla-indigo-600: #4f46e5;
  --yalla-purple-500: #a855f7;
  --yalla-purple-600: #9333ea;
  
  /* Accent Colors */
  --yalla-amber-500: #f59e0b;
  --yalla-amber-600: #d97706;
  --yalla-orange-500: #f97316;
  --yalla-orange-600: #ea580c;
  
  /* Semantic Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  
  /* Neutrals - Gray Scale */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;
  
  /* Slate Scale (for text) */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;
  
  /* ========================================
     SEMANTIC TOKEN MAPPING - Light Mode
     ======================================== */
  
  /* Primary Brand */
  --color-primary: var(--yalla-emerald-500);
  --color-primary-strong: var(--yalla-emerald-600);
  --color-primary-subtle: var(--yalla-emerald-50);
  
  /* Backgrounds */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: var(--gray-50);
  --color-bg-tertiary: var(--gray-100);
  --color-bg-elevated: rgba(255, 255, 255, 0.9);
  --color-bg-hover: var(--gray-100);
  --color-bg-active: var(--gray-200);
  
  /* Text */
  --color-text-primary: var(--slate-900);
  --color-text-secondary: var(--slate-600);
  --color-text-tertiary: var(--slate-500);
  --color-text-inverse: #ffffff;
  --color-text-link: var(--yalla-turquoise-600);
  
  /* Borders */
  --color-border-subtle: var(--gray-200);
  --color-border-strong: var(--gray-300);
  --color-border-interactive: var(--yalla-emerald-500);
  
  /* Component-specific */
  --color-input-bg: #ffffff;
  --color-input-border: var(--gray-300);
  --color-input-focus: var(--yalla-emerald-500);
  
  /* ========================================
     TYPOGRAPHY SCALE
     ======================================== */
  
  /* Font Families */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-arabic: 'Noto Naskh Arabic', 'Amiri', 'Times New Roman', serif;
  
  /* Font Sizes */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 2rem;        /* 32px */
  --text-display-xs: 2.25rem;  /* 36px */
  --text-display-sm: 3rem;     /* 48px */
  --text-display-md: 4rem;     /* 64px */
  --text-display-lg: 5rem;     /* 80px */
  --text-display-xl: 6rem;     /* 96px */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  --leading-loose: 2;
  
  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  
  /* ========================================
     SPACING SCALE (4px base)
     ======================================== */
  
  --space-0: 0;
  --space-05: 0.125rem;  /* 2px */
  --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-14: 3.5rem;    /* 56px */
  --space-16: 4rem;      /* 64px */
  --space-18: 4.5rem;    /* 72px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */
  --space-48: 12rem;     /* 192px */
  --space-64: 16rem;     /* 256px */
  --space-96: 24rem;     /* 384px */
  
  /* ========================================
     BORDER RADIUS
     ======================================== */
  
  --radius-none: 0;
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-3xl: 2rem;     /* 32px */
  --radius-full: 9999px;  /* Pill shape */
  
  /* ========================================
     SHADOWS
     ======================================== */
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  
  /* ========================================
     TRANSITIONS & ANIMATIONS
     ======================================== */
  
  --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-all: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ========================================
     FOCUS & INTERACTION
     ======================================== */
  
  --focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.2);
  --focus-ring-offset: 0 0 0 2px #ffffff, 0 0 0 4px rgba(16, 185, 129, 0.2);
  
  /* ========================================
     Z-INDEX SCALE
     ======================================== */
  
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal-backdrop: 1300;
  --z-modal: 1400;
  --z-popover: 1500;
  --z-tooltip: 1600;
}

/* ========================================
   DARK MODE THEME
   ======================================== */

[data-theme="dark"] {
  /* Primary (slightly brighter in dark mode) */
  --color-primary: var(--yalla-emerald-400);
  --color-primary-strong: var(--yalla-emerald-500);
  --color-primary-subtle: rgba(16, 185, 129, 0.1);
  
  /* Backgrounds */
  --color-bg-primary: var(--slate-950);
  --color-bg-secondary: var(--slate-900);
  --color-bg-tertiary: var(--slate-800);
  --color-bg-elevated: rgba(15, 23, 42, 0.9);
  --color-bg-hover: var(--slate-800);
  --color-bg-active: var(--slate-700);
  
  /* Text */
  --color-text-primary: var(--slate-50);
  --color-text-secondary: var(--slate-400);
  --color-text-tertiary: var(--slate-500);
  --color-text-inverse: var(--slate-900);
  --color-text-link: var(--yalla-turquoise-400);
  
  /* Borders */
  --color-border-subtle: var(--slate-800);
  --color-border-strong: var(--slate-700);
  --color-border-interactive: var(--yalla-emerald-400);
  
  /* Component-specific */
  --color-input-bg: var(--slate-900);
  --color-input-border: var(--slate-700);
  --color-input-focus: var(--yalla-emerald-400);
  
  /* Shadows (darker in dark mode) */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  
  /* Focus ring */
  --focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.3);
  --focus-ring-offset: 0 0 0 2px var(--slate-950), 0 0 0 4px rgba(16, 185, 129, 0.3);
}

/* ========================================
   ACCESSIBILITY - Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 1ms;
    --transition-base: 1ms;
    --transition-all: 1ms;
    --transition-slow: 1ms;
  }
}
