/* ═══════════════════════════════════════════════════════════════
   Design System — CSS Custom Properties (Tokens)
   app-exams.com — Web Interface
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'DIN';
  src: url('../fonts/DIN.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── Primary Palette ─────────────────────────────────────── */
  --color-primary: #2563EB;
  --color-primary-light: #3B82F6;
  --color-primary-dark: #1D4ED8;
  --color-secondary: #0EA5E9;
  --color-accent: #F59E0B;
  --color-success: #10B981;
  --color-danger: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #06B6D4;

  /* ── Backgrounds ─────────────────────────────────────────── */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-overlay: rgba(15, 23, 42, 0.6);

  /* ── Text ────────────────────────────────────────────────── */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  --text-link: #2563EB;

  /* ── Borders ─────────────────────────────────────────────── */
  --border-color: #E2E8F0;
  --border-light: #F1F5F9;
  --border-focus: #2563EB;

  /* ── Shadows ─────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --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);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);

  /* ── Border Radius ───────────────────────────────────────── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ── Typography ──────────────────────────────────────────── */
  --font-ar: 'DIN', 'Cairo', 'Tahoma', sans-serif;
  --font-en: 'DIN', 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* ── Spacing ─────────────────────────────────────────────── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ── Gradients ───────────────────────────────────────────── */
  --gradient-hero: linear-gradient(135deg, #1E3A8A 0%, #2563EB 50%, #0EA5E9 100%);
  --gradient-card: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
  --gradient-cta: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  --gradient-dark: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);

  /* ── Transitions ─────────────────────────────────────────── */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-spring: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ── Z-Index Scale ───────────────────────────────────────── */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;

  /* ── Breakpoints (referenced as comments only) ───────────── */
  /* --bp-mobile: 480px;  */
  /* --bp-tablet: 768px;  */
  /* --bp-desktop: 1024px; */
  /* --bp-wide: 1280px;   */
  /* --bp-ultrawide: 1536px; */

  /* ── Container Widths ────────────────────────────────────── */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1400px;

  /* ── Sidebar ─────────────────────────────────────────────── */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --navbar-height: 64px;
}

/* ── RTL Overrides ──────────────────────────────────────────── */
[dir="rtl"] {
  font-family: var(--font-ar);
}

[dir="ltr"] {
  font-family: var(--font-en);
}

body {
  font-family: var(--font-ar);
}

[dir="ltr"] body {
  font-family: var(--font-en);
}

/* ── Dark Theme Overrides ────────────────────────────────── */
body.dark-theme,
[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #020617;
  --bg-tertiary: #1E293B;
  --bg-card: #1E293B;
  
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --text-inverse: #0F172A;
  
  --border-color: #334155;
  --border-light: #1E293B;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}
