/* Design System Variables */
:root {
  /* Colors */
  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-500: #1e3a5f;
  --color-primary-600: #1e40af;
  --color-primary-700: #1d4ed8;
  --color-primary-900: #1e3a8a;
  
  --color-secondary-50: #ecfdf5;
  --color-secondary-100: #d1fae5;
  --color-secondary-500: #006c35;
  --color-secondary-600: #059669;
  --color-secondary-700: #047857;
  
  --color-accent-400: #fbbf24;
  --color-accent-500: #d4af37;
  --color-accent-600: #d97706;
  
  --color-success-500: #10b981;
  --color-success-600: #059669;
  
  --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;
  
  --color-white: #ffffff;
  --color-black: #000000;
  
  /* Semantic Colors */
  --primary-color: var(--color-primary-500);
  --secondary-color: var(--color-secondary-500);
  --accent-color: var(--color-accent-500);
  --success-color: var(--color-success-500);
  --text-primary: var(--color-gray-900);
  --text-secondary: var(--color-gray-600);
  --text-tertiary: var(--color-gray-500);
  --background: var(--color-white);
  --surface: var(--color-gray-50);
  --surface-elevated: var(--color-white);
  --border: var(--color-gray-200);
  --border-light: var(--color-gray-100);
  
  /* 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);
  
  /* Border Radius */
  --radius-none: 0px;
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Spacing Scale */
  --space-px: 1px;
  --space-0: 0px;
  --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;
  --space-32: 8rem;
  --space-40: 10rem;
  --space-48: 12rem;
  --space-56: 14rem;
  --space-64: 16rem;
  
  /* Typography */
  --font-family-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-family-arabic: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --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;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  --font-size-7xl: 4.5rem;
  --font-size-8xl: 6rem;
  --font-size-9xl: 8rem;
  
  --font-weight-thin: 100;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;
  
  --line-height-none: 1;
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Animation */
  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;
  
  --ease-linear: linear;
  --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);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: var(--line-height-normal);
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[dir="rtl"] body {
  font-family: var(--font-family-arabic);
  letter-spacing: 0.01em;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  z-index: 1000;
  transition: top var(--duration-200) var(--ease-out);
}

.skip-link:focus {
  top: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Management */
:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-snug);
  letter-spacing: 0;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-none);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-200) var(--ease-in-out);
  min-height: 48px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform var(--duration-300) var(--ease-out);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--color-primary-600));
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  padding: var(--space-4) 0;
  transition: all var(--duration-300) var(--ease-out);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-login-btn {
  padding: var(--space-2) var(--space-5);
  font-size: var(--font-size-sm);
  min-height: 44px;
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-md);
}

.nav-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.nav-brand h2 {
  color: var(--primary-color);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-2xl);
  margin: 0;
  letter-spacing: -0.025em;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-200) var(--ease-in-out);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.lang-switch:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.lang-icon {
  font-size: var(--font-size-sm);
}

/* Hero Section */
.hero {
  padding: var(--space-32) 0 var(--space-32);
  background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 40%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(30, 58, 95, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, var(--secondary-color), var(--color-secondary-600));
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-md);
  width: fit-content;
}

.badge-icon {
  font-size: var(--font-size-xs);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-title {
  font-size: clamp(var(--font-size-4xl), 6vw, var(--font-size-7xl));
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-none);
  margin-bottom: var(--space-6);
  color: var(--primary-color);
  letter-spacing: -0.025em;
}

.title-primary {
  display: block;
  color: var(--text-primary);
}

.title-secondary {
  display: block;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  line-height: var(--line-height-relaxed);
  max-width: 90%;
}

.hero-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.feature-icon-small {
  width: 32px;
  height: 32px;
  background: var(--success-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.feature-icon-small i {
  width: 16px;
  height: 16px;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-login-btn {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-lg);
  min-height: 60px;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.hero-login-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.hero-login-btn:hover::after {
  width: 300px;
  height: 300px;
}

.hero-login-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2xl);
}

/* Chart Container */
.chart-container {
  background: var(--surface-elevated);
  padding: var(--space-8);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-2xl);
  border: 1px solid var(--border);
  position: relative;
}

.chart-header h3 {
  text-align: center;
  margin-bottom: var(--space-6);
  color: var(--primary-color);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
}

.chart-wrapper {
  position: relative;
  height: 280px;
}

#growthChart {
  max-height: 100%;
}

.chart-stats {
  display: flex;
  justify-content: space-around;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-light);
}

.chart-stats .stat-item {
  text-align: center;
}

.chart-stats .stat-number {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--secondary-color);
  margin-bottom: var(--space-1);
}

.chart-stats .stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

/* Currency Symbol */
.currency-symbol {
  display: inline-flex;
  align-items: center;
  margin-right: var(--space-1);
  vertical-align: middle;
}

[dir="rtl"] .currency-symbol {
  margin-right: 0;
  margin-left: var(--space-1);
}

.currency-symbol svg {
  width: 16px;
  height: 16px;
  color: var(--secondary-color);
}

/* Footer */
.footer {
  background: var(--surface);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-bottom {
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
}

/* RTL Enhancements */
[dir="rtl"] {
  text-align: right;
}

/* ...existing RTL styles... */

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-content {
    gap: var(--space-12);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-24) 0;
    min-height: 100vh;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-12);
    text-align: center;
  }
  
  .hero-visual {
    order: -1;
  }
  
  .hero-subtitle {
    max-width: 100%;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .btn {
    min-width: 200px;
  }
  
  .chart-container {
    padding: var(--space-6);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .hero {
    padding: var(--space-20) 0;
  }
  
  .navbar {
    padding: var(--space-3) 0;
  }
  
  .chart-container {
    padding: var(--space-4);
  }
  
  .hero-badge {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-3);
  }
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  .feature-card,
  .stats .stat-item,
  .btn {
    transition: all var(--duration-300) var(--ease-out);
  }
  
  .hero::before {
    animation: float 20s ease-in-out infinite;
  }
}

@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  50% { 
    transform: translateY(-20px) rotate(1deg); 
  }
}

/* Print Styles */
@media print {
  .navbar,
  .skip-link {
    display: none;
  }
  
  .hero {
    padding: var(--space-8) 0;
  }
  
  * {
    box-shadow: none !important;
  }
}