:root {
  /* Enhanced color palette with better contrast */
  --background: #ffffff;
  --foreground: #1e293b;
  --card: #f8fafc;
  --card-foreground: #0f172a;
  --popover: #ffffff;
  --popover-foreground: #1e293b;
  --primary: #0f172a;
  --primary-foreground: #ffffff;
  --secondary: #f97316;
  --secondary-foreground: #ffffff;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #f97316;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #f8fafc;
  --ring: rgba(15, 23, 42, 0.1);
  
  /* Enhanced chart colors */
  --chart-1: #0f172a;
  --chart-2: #f97316;
  --chart-3: #ef4444;
  --chart-4: #ffffff;
  --chart-5: #64748b;
  
  /* Improved spacing and sizing */
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  
  /* Enhanced shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 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);
  
  /* Sidebar colors */
  --sidebar: #ffffff;
  --sidebar-foreground: #1e293b;
  --sidebar-primary: #0f172a;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #f97316;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-ring: rgba(15, 23, 42, 0.1);
}

.dark {
  --background: #0f172a;
  --foreground: #f8fafc;
  --card: #1e293b;
  --card-foreground: #f8fafc;
  --popover: #1e293b;
  --popover-foreground: #f8fafc;
  --primary: #3b82f6;
  --primary-foreground: #0f172a;
  --secondary: #f97316;
  --secondary-foreground: #ffffff;
  --muted: #334155;
  --muted-foreground: #94a3b8;
  --accent: #f97316;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #334155;
  --input: #1e293b;
  --ring: rgba(59, 130, 246, 0.2);
  
  --chart-1: #3b82f6;
  --chart-2: #f97316;
  --chart-3: #ef4444;
  --chart-4: #ffffff;
  --chart-5: #94a3b8;
  
  --sidebar: #1e293b;
  --sidebar-foreground: #f8fafc;
  --sidebar-primary: #3b82f6;
  --sidebar-primary-foreground: #0f172a;
  --sidebar-accent: #f97316;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #334155;
  --sidebar-ring: rgba(59, 130, 246, 0.2);
}

/* Base styles with improved typography and spacing */
* {
  border-color: var(--border);
  outline-color: var(--ring);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  font-feature-settings: "rlig" 1, "calt" 1;
}

/* Enhanced typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* Improved spacing utilities */
.section-padding {
  padding: 5rem 0;
}

.section-padding-sm {
  padding: 3rem 0;
}

.section-padding-lg {
  padding: 7rem 0;
}

/* Enhanced container */
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Custom styles for Arabic text */
.rtl {
  direction: rtl;
  text-align: right;
}

.ltr {
  direction: ltr;
  text-align: left;
}

/* Smooth transitions for language switching */
.fade-transition {
  transition: opacity 0.3s ease-in-out;
}

/* Enhanced scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--muted);
  border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius);
  border: 2px solid var(--muted);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Modern focus styles */
.focus-ring {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus-ring:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Enhanced animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

/* Staggered animations for lists */
.animate-stagger > * {
  animation: fadeInUp 0.6s ease-out;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* Glass morphism effects */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Enhanced gradients */
.gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.gradient-card {
  background: linear-gradient(135deg, var(--card) 0%, var(--background) 100%);
}

.gradient-hero {
  background: linear-gradient(135deg, var(--card) 0%, var(--muted) 50%, var(--background) 100%);
}

/* Improved shadows */
.shadow-soft {
  box-shadow: var(--shadow-soft, 0 2px 15px rgba(0, 0, 0, 0.08));
}

.shadow-medium {
  box-shadow: var(--shadow-md);
}

.shadow-strong {
  box-shadow: var(--shadow-xl);
}

/* Enhanced borders */
.border-soft {
  border: 1px solid var(--border);
}

.border-medium {
  border: 2px solid var(--border);
}

/* Responsive utilities */
@media (max-width: 640px) {
  .section-padding {
    padding: 3rem 0;
  }
  
  .section-padding-lg {
    padding: 4rem 0;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    color: black;
    background-color: white;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid currentColor;
  }
  
  .nav-link {
    border-bottom: 1px solid transparent;
  }
  
  .nav-link:hover {
    border-bottom-color: currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
