/* ============================================
   ENGLISH M3AYA — Global Styles & Design System
   ============================================ */

/* --- CSS Custom Properties (Theme Tokens) --- */
:root {
  /* Colors */
  --color-primary: #0d1b3e;
  --color-primary-light: #1a2d5a;
  --color-primary-dark: #070e1f;
  --color-secondary: #d4af37;
  --color-secondary-light: #e8c84a;
  --color-secondary-dark: #b8941f;
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-surface-hover: #eef1f8;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-text-light: #9ca3af;
  --color-border: #e5e7eb;
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-info: #3b82f6;
  --color-info-light: #dbeafe;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* 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;

  /* Borders & Shadows */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  /* Transitions - Premium SaaS Easing Curves */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-spring: 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-primary: #4a7dff;
  --color-primary-light: #6b97ff;
  --color-primary-dark: #2d5fd9;
  --color-secondary: #d4af37;
  --color-secondary-light: #e8c84a;
  --color-bg: #0f1117;
  --color-surface: #1a1d2e;
  --color-surface-hover: #252839;
  --color-text: #e5e7eb;
  --color-text-muted: #9ca3af;
  --color-text-light: #6b7280;
  --color-border: #2d3040;
  --color-success: #34d399;
  --color-success-light: #064e3b;
  --color-error: #f87171;
  --color-error-light: #7f1d1d;
  --color-warning: #fbbf24;
  --color-warning-light: #78350f;
  --color-info: #60a5fa;
  --color-info-light: #1e3a5f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
  transition: background var(--transition), color var(--transition);
}

/* Arabic font override for RTL */
[dir="rtl"] body,
body.rtl,
[dir="rtl"] {
  font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] p, [dir="rtl"] a, [dir="rtl"] span, [dir="rtl"] button, [dir="rtl"] input, [dir="rtl"] .lp-stat-chip .num,
[dir="rtl"] .lp-level-name, [dir="rtl"] .lp-why-visual .big, [dir="rtl"] .lp-footer-logo,
[dir="rtl"] .static-hero-title, [dir="rtl"] .static-page-content * {
  font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

img {
  max-width: 100%;
  display: block;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }

/* --- Scrollbar & Scroll Utils --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-light);
}
.hide-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* --- App Container --- */
#app {
  min-height: 100vh;
  position: relative;
  /* Prevent horizontal layout shifts during transitions */
  overflow-x: hidden;
}

/* --- Utility Classes --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
