/* ==========================================
   DIGITAL DESERT - المتغيرات الأساسية
   ========================================== */
:root {
  --primary-color: #5b21b6;
  --secondary-color: #ec4899;
  --dark-bg: #0f172a;
  --light-bg: #f8fafc;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* ==========================================
   الأساسيات والتصفير
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  background: var(--light-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==========================================
   الحاويات والتخطيط
   ========================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--primary-color);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  bottom: -15px;
  right: 0;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 40px;
  max-width: 600px;
}

/* ==========================================
   الأزرار
   ========================================== */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 15px 30px rgba(91, 33, 182, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(91, 33, 182, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.btn-white {
  background: white;
  color: var(--primary-color);
}

.btn-white:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* ==========================================
   النصوص والروابط
   ========================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 15px;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

/* ==========================================
   البطاقات والعناصر
   ========================================== */
.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  height: 100%;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: white;
}

/* ==========================================
   الشبكات والأعمدة
   ========================================== */
.grid {
  display: grid;
  gap: 30px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ==========================================
   الفاصل والتقسيم (Divider)
   ========================================== */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 40px 0;
}

/* ==========================================
   الحركات والتأثيرات
   ========================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out forwards;
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ==========================================
   العناصر المرئية
   ========================================== */
.badge {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.icon-box {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  margin: 0 auto 20px;
}

/* ==========================================
   Pre-loader
   ========================================== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeOut 0.5s ease-out forwards;
  animation-delay: 2s;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ==========================================
   المحتوى والقراءة
   ========================================== */
.highlight {
  background: linear-gradient(120deg, rgba(91, 33, 182, 0.1), rgba(236, 72, 153, 0.1));
  padding: 2px 6px;
  border-radius: 4px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================
   الصور والوسائط
   ========================================== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-rounded {
  border-radius: 15px;
  overflow: hidden;
}

.img-shadow {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   الاستجابة (Responsive)
   ========================================== */
@media (max-width: 1024px) {
  .section {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 40px 0;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .section {
    padding: 30px 0;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}
