/* ========================================
   CSS Design System Variables
   متغيرات نظام التصميم
   ======================================== */

:root {
    /* ===== Color Palette ===== */
    
    /* Primary Brand Colors - الألوان الرئيسية */
    --color-primary-50: #eff6ff;
    --color-primary-100: #dbeafe;
    --color-primary-200: #bfdbfe;
    --color-primary-300: #93c5fd;
    --color-primary-400: #60a5fa;
    --color-primary-500: #3b82f6;
    --color-primary-600: #2563eb;
    --color-primary-700: #1d4ed8;
    --color-primary-800: #1e40af;
    --color-primary-900: #1e3a8a;
    
    /* Success Colors - ألوان النجاح */
    --color-success-50: #f0fdf4;
    --color-success-100: #dcfce7;
    --color-success-200: #bbf7d0;
    --color-success-300: #86efac;
    --color-success-400: #4ade80;
    --color-success-500: #22c55e;
    --color-success-600: #16a34a;
    --color-success-700: #15803d;
    --color-success-800: #166534;
    --color-success-900: #14532d;
    
    /* Warning Colors - ألوان التحذير */
    --color-warning-50: #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-200: #fde68a;
    --color-warning-300: #fcd34d;
    --color-warning-400: #fbbf24;
    --color-warning-500: #f59e0b;
    --color-warning-600: #d97706;
    --color-warning-700: #b45309;
    --color-warning-800: #92400e;
    --color-warning-900: #78350f;
    
    /* Danger Colors - ألوان الخطر */
    --color-danger-50: #fef2f2;
    --color-danger-100: #fee2e2;
    --color-danger-200: #fecaca;
    --color-danger-300: #fca5a5;
    --color-danger-400: #f87171;
    --color-danger-500: #ef4444;
    --color-danger-600: #dc2626;
    --color-danger-700: #b91c1c;
    --color-danger-800: #991b1b;
    --color-danger-900: #7f1d1d;
    
    /* Info Colors - ألوان المعلومات */
    --color-info-50: #ecfeff;
    --color-info-100: #cffafe;
    --color-info-200: #a5f3fc;
    --color-info-300: #67e8f9;
    --color-info-400: #22d3ee;
    --color-info-500: #06b6d4;
    --color-info-600: #0891b2;
    --color-info-700: #0e7490;
    --color-info-800: #155e75;
    --color-info-900: #164e63;
    
    /* Neutral/Gray Colors - الألوان المحايدة */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --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;
    
    /* ===== Semantic Color Aliases ===== */
    --primary: var(--color-primary-600);
    --primary-dark: var(--color-primary-700);
    --primary-light: var(--color-primary-500);
    --success: var(--color-success-500);
    --success-dark: var(--color-success-600);
    --warning: var(--color-warning-500);
    --danger: var(--color-danger-500);
    --info: var(--color-info-500);
    
    /* ===== Background Colors ===== */
    --bg-body: var(--color-gray-100);
    --bg-primary: var(--white);
    --bg-secondary: var(--color-gray-50);
    --bg-tertiary: var(--color-gray-100);
    --bg-inverse: var(--color-gray-900);
    
    /* ===== Text Colors ===== */
    --text-primary: var(--color-gray-900);
    --text-secondary: var(--color-gray-600);
    --text-tertiary: var(--color-gray-400);
    --text-inverse: var(--white);
    --text-muted: var(--color-gray-500);
    
    /* ===== Border Colors ===== */
    --border-color: var(--color-gray-200);
    --border-color-light: var(--color-gray-100);
    --border-color-dark: var(--color-gray-300);
    
    /* ===== Special Colors ===== */
    --white: #ffffff;
    --black: #000000;
    --transparent: transparent;
    
    /* ===== Typography ===== */
    --font-family-base: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --font-family-mono: 'Courier New', Consolas, monospace;
    
    /* Font Sizes */
    --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 Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* ===== Spacing Scale ===== */
    --spacing-0: 0;
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    
    /* ===== Border Radius ===== */
    --radius-none: 0;
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.375rem;  /* 6px */
    --radius-lg: 0.5rem;    /* 8px */
    --radius-xl: 0.75rem;   /* 12px */
    --radius-2xl: 1rem;     /* 16px */
    --radius-3xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
    
    /* ===== Shadows ===== */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --shadow-none: 0 0 #0000;
    
    /* ===== Transitions ===== */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-slower: 500ms ease;
    
    /* Specific Transitions */
    --transition-colors: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
    --transition-transform: transform 200ms ease;
    --transition-opacity: opacity 200ms ease;
    --transition-shadow: box-shadow 200ms ease;
    
    /* ===== Z-Index Scale ===== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* ===== Layout ===== */
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 64px;
    --header-height: 64px;
    --container-max-width: 1280px;
    
    /* ===== Touch Targets (Mobile) ===== */
    --touch-target-min: 44px;  /* Apple HIG guideline */
    
    /* ===== Safe Areas (Notch devices) ===== */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* ===== Legacy Variable Aliases (for backwards compatibility) ===== */
:root {
    /* Map old variable names to new system */
    --primary-color: var(--primary);
    --primary-dark: var(--color-primary-700);
    --primary-light: var(--color-primary-500);
    --success-color: var(--success);
    --success-dark: var(--color-success-600);
    --warning-color: var(--warning);
    --danger-color: var(--danger);
    --info-color: var(--info);
    
    --dark-color: var(--color-gray-900);
    --light-color: var(--color-gray-50);
    --gray-800: var(--color-gray-800);
    --gray-700: var(--color-gray-700);
    --gray-600: var(--color-gray-600);
    --gray-500: var(--color-gray-500);
    --gray-400: var(--color-gray-400);
    --gray-300: var(--color-gray-300);
    --gray-200: var(--color-gray-200);
    --gray-100: var(--color-gray-100);
    --gray-50: var(--color-gray-50);
}
