/* ===================================
   أدوات PDF - نظام التصميم الرئيسي
   Main Design System & Variables
   =================================== */

/* استيراد خط Cairo العربي */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');

/* ===================================
   CSS Custom Properties (المتغيرات)
   =================================== */
:root {
  /* الألوان الأساسية - Dark Professional Theme */
  --color-primary: #6366f1;
  /* Indigo */
  --color-primary-light: #818cf8;
  --color-primary-dark: #4f46e5;

  --color-secondary: #a855f7;
  /* Purple */
  --color-secondary-light: #c084fc;
  --color-secondary-dark: #9333ea;

  --color-accent: #3b82f6;
  /* Blue */
  --color-accent-light: #60a5fa;
  --color-accent-dark: #2563eb;

  /* خلفيات داكنة */
  --color-bg: #0f172a;
  /* Dark blue background */
  --color-bg-alt: #1e293b;
  --color-surface: #1e293b;
  --color-surface-light: #334155;
  --color-surface-lighter: #475569;

  /* نصوص */
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-dark: #64748b;

  /* ألوان دلالية */
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;

  /* تأثيرات الزجاج (Glassmorphism) */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  --glass-blur: 20px;

  /* ظلال */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* حواف مستديرة */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* انتقالات */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* مسافات */
  --space-xs: 0.25rem;
  /* 4px */
  --space-sm: 0.5rem;
  /* 8px */
  --space-md: 1rem;
  /* 16px */
  --space-lg: 1.5rem;
  /* 24px */
  --space-xl: 2rem;
  /* 32px */
  --space-2xl: 3rem;
  /* 48px */
  --space-3xl: 4rem;
  /* 64px */
  --space-4xl: 6rem;
  /* 96px */

  /* خطوط */
  --font-primary: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* أحجام الخطوط */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.875rem;
  /* 30px */
  --text-4xl: 2.25rem;
  /* 36px */
  --text-5xl: 3rem;
  /* 48px */

  /* أوزان الخطوط */
  --font-light: 300;
  --font-normal: 400;
  --font-semibold: 600;
  --font-bold: 700;
  --font-black: 900;

  /* ارتفاعات الأسطر (محسّنة للعربية) */
  --leading-tight: 1.4;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* نقاط التوقف (Breakpoints) */
  --bp-mobile: 320px;
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
  --bp-wide: 1440px;
}

/* ===================================
   إعادة تعيين أساسية (Reset)
   =================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* ===================================
   خلفية متحركة مع تدرج لوني
   =================================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: radial-gradient(ellipse at top,
      var(--color-bg-alt) 0%,
      var(--color-bg) 50%,
      var(--color-bg) 100%);
  opacity: 1;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ===================================
   جزيئات عائمة في الخلفية
   =================================== */
.particle {
  position: fixed;
  width: 4px;
  height: 4px;
  background: rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.particle:nth-child(1) {
  animation: float 25s infinite;
  left: 10%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  animation: float 20s infinite;
  left: 25%;
  animation-delay: 2s;
}

.particle:nth-child(3) {
  animation: float 30s infinite;
  left: 40%;
  animation-delay: 4s;
}

.particle:nth-child(4) {
  animation: float 22s infinite;
  left: 55%;
  animation-delay: 1s;
}

.particle:nth-child(5) {
  animation: float 28s infinite;
  left: 70%;
  animation-delay: 3s;
}

.particle:nth-child(6) {
  animation: float 24s infinite;
  left: 85%;
  animation-delay: 5s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 0.5;
  }

  90% {
    opacity: 0.5;
  }

  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

/* ===================================
   تأثيرات Glassmorphism
   =================================== */
.glass-card {
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

/* توهج داخلي للكرت */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  pointer-events: none;
}

.glass-card:hover {
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.15),
      rgba(255, 255, 255, 0.08));
  border-color: var(--glass-border-hover);
  transform: translateY(-8px);
  box-shadow:
    var(--shadow-xl),
    var(--shadow-glow);
}

/* fallback للمتصفحات القديمة */
@supports not (backdrop-filter: blur(20px)) {
  .glass-card {
    background: rgba(30, 41, 59, 0.85);
  }
}

/* ===================================
   العناوين
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-black);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

/* ===================================
   الأزرار
   =================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--color-text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.btn-large {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-lg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===================================
   حاوية رئيسية
   =================================== */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-2xl);
  }
}

/* ===================================
   الأقسام
   =================================== */
section {
  position: relative;
  z-index: 1;
}

.section-padding {
  padding: var(--space-3xl) 0;
}

@media (min-width: 768px) {
  .section-padding {
    padding: var(--space-4xl) 0;
  }
}

/* ===================================
   أدوات مساعدة (Utilities)
   =================================== */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.mb-2xl {
  margin-bottom: var(--space-2xl);
}

.mb-3xl {
  margin-bottom: var(--space-3xl);
}

.mb-4xl {
  margin-bottom: var(--space-4xl);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

/* ===================================
   تحميل/Loading
   =================================== */
.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}