:root {
  --primary: #c9a84c;
  --primary-light: #e8d5a3;
  --primary-dark: #a08030;
  --accent: #22c97a;
  --accent-warm: #f97316;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #26354d;
  --bg-glass: rgba(30, 41, 59, 0.7);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(201, 168, 76, 0.15);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(201, 168, 76, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --star-color: #fbbf24;
  --whatsapp: #25d366;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════
   خلفية متحركة بالجسيمات
═══════════════════════════════════════════════ */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   شريط التنقل العلوي
═══════════════════════════════════════════════ */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(15,23,42,0.95), rgba(15,23,42,0.7));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.top-nav.scrolled {
  padding: 10px 24px;
  background: rgba(15,23,42,0.98);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
  text-decoration: none;
}

.nav-logo img {
  width: 38px; height: 38px;
  border-radius: 10px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(201, 168, 76, 0.08);
}

.nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0f172a !important;
  font-weight: 700;
  padding: 10px 24px !important;
  border-radius: 24px;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
  transition: all 0.3s ease;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(201, 168, 76, 0.4);
}

/* ═══════════════════════════════════════════════
   Hero Section
═══════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  text-align: center;
  z-index: 1;
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 1s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--primary-light);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hero-badge .pulse {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  display: block;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0f172a;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 16px 40px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.35);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 40px rgba(201, 168, 76, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: 30px;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(201, 168, 76, 0.05);
}

/* ═══════════════════════════════════════════════
   قسم الإحصائيات المتحركة
═══════════════════════════════════════════════ */
.stats-bar {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(30,41,59,0.9), rgba(15,23,42,0.95));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 24px;
}

.stats-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.stat-card {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255,255,255,0.04);
  transform: translateY(-4px);
}

.stat-card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.stat-card-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════
   قسم البطاقات المتنوعة (PDF + YouTube)
═══════════════════════════════════════════════ */
.section {
  position: relative;
  z-index: 1;
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-block;
  background: rgba(201, 168, 76, 0.1);
  color: var(--primary);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════
   🎛️ نظام الفلاتر
═══════════════════════════════════════════════ */
.filters-wrapper {
  background: linear-gradient(135deg, rgba(30,41,59,0.6), rgba(15,23,42,0.4));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}

.filters-top {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  right: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 44px 12px 44px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

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

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.search-clear {
  position: absolute;
  left: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.search-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.category-select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 160px;
  transition: all 0.25s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
  padding-left: 36px;
}

.category-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.category-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.refresh-btn {
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.refresh-btn svg {
  width: 18px;
  height: 18px;
}

.refresh-btn:hover {
  background: rgba(201, 168, 76, 0.15);
  transform: rotate(180deg);
}

.refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

.filter-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-chip {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 9px 18px;
  border-radius: 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: rgba(201, 168, 76, 0.3);
  color: var(--text-primary);
  background: rgba(201, 168, 76, 0.05);
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0f172a;
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.25);
}

.chip-count {
  background: rgba(15, 23, 42, 0.4);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}

.filter-chip.active .chip-count {
  background: rgba(15, 23, 42, 0.25);
}

.filter-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.results-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.results-count strong {
  color: var(--primary);
}

.cache-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(34, 201, 122, 0.08);
  border: 1px solid rgba(34, 201, 122, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
}

.cache-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 2s infinite;
}

.cache-indicator.refreshing .cache-dot {
  background: var(--accent-warm);
  box-shadow: 0 0 6px var(--accent-warm);
}

.cache-indicator.fresh {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

.cache-indicator.fresh .cache-dot {
  background: #3b82f6;
  box-shadow: 0 0 6px #3b82f6;
}

/* ── شبكة البطاقات ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.resource-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.resource-card.hidden-by-filter {
  display: none;
}

.resource-card:hover {
  transform: translateY(-8px);
  border-color: rgba(201, 168, 76, 0.3);
  box-shadow: var(--shadow-glow);
}

.resource-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.resource-card:hover::before { opacity: 1; }

.card-image-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a2744, #0f172a);
}

.card-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.resource-card:hover .card-image-wrap img {
  transform: scale(1.08);
}

.card-type-badge {
  position: absolute;
  top: 12px; right: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(10px);
}

.badge-pdf { background: rgba(239, 68, 68, 0.9); color: white; }
.badge-video { background: rgba(59, 130, 246, 0.9); color: white; }
.badge-youtube { background: rgba(239, 68, 68, 0.9); color: white; }

.card-body {
  padding: 20px;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-action {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s ease;
}

.resource-card:hover .card-action { gap: 10px; }

/* حالة عدم وجود نتائج */
.no-results {
  text-align: center;
  padding: 60px 24px;
  background: rgba(30, 41, 59, 0.4);
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.no-results-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.no-results h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.no-results p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   قسم المميزات (Features)
═══════════════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(30,41,59,0.5));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 0;
  background: linear-gradient(to top, rgba(201,168,76,0.08), transparent);
  transition: height 0.35s ease;
}

.feature-card:hover::after { height: 100%; }

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 168, 76, 0.25);
}

.feature-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,168,76,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 20px;
  border: 1px solid rgba(201, 168, 76, 0.15);
  position: relative;
  z-index: 1;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════
   ⭐ قسم الشهادات (Testimonials) مع تقييم النجوم
═══════════════════════════════════════════════ */
.overall-rating {
  margin-top: 24px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 14px 28px;
  border-radius: 14px;
}

.overall-rating-stars {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overall-rating-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--star-color);
  font-weight: 800;
}

.overall-rating-number strong {
  font-size: 1.5rem;
  line-height: 1;
}

.overall-rating-number span {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.overall-rating-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.overall-rating-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* عرض النجوم */
.stars-display {
  display: inline-flex;
  gap: 2px;
  position: relative;
}

.stars-display .star {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: color 0.3s ease, transform 0.2s ease;
}

.stars-display .star.filled {
  color: var(--star-color);
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.4));
}

.stars-display.large .star {
  width: 22px;
  height: 22px;
}

@keyframes star-pop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.stars-display .star.filled {
  animation: star-pop 0.4s ease backwards;
}

.stars-display .star.filled:nth-child(1) { animation-delay: 0.05s; }
.stars-display .star.filled:nth-child(2) { animation-delay: 0.1s; }
.stars-display .star.filled:nth-child(3) { animation-delay: 0.15s; }
.stars-display .star.filled:nth-child(4) { animation-delay: 0.2s; }
.stars-display .star.filled:nth-child(5) { animation-delay: 0.25s; }

.testimonials-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.testimonials-track::-webkit-scrollbar { display: none; }

.testimonial-card {
  flex: 0 0 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  scroll-snap-align: start;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.testimonial-card:hover {
  border-color: rgba(201, 168, 76, 0.2);
  transform: translateY(-4px);
}

.testimonial-rating {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.testimonial-rating-num {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.testimonial-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
  font-style: italic;
  flex: 1;
}

.testimonial-text::before {
  content: '"';
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.3;
  line-height: 0;
  vertical-align: middle;
  margin-left: 4px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0f172a;
  font-size: 1rem;
  flex-shrink: 0;
}

.testimonial-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.testimonial-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   ❓ قسم الأسئلة الشائعة (FAQ Accordion)
═══════════════════════════════════════════════ */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: linear-gradient(135deg, var(--bg-card), rgba(30,41,59,0.5));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(201, 168, 76, 0.25);
}

.faq-item.active {
  border-color: rgba(201, 168, 76, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 20px 24px;
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s ease;
}

.faq-question:hover {
  background: rgba(201, 168, 76, 0.04);
}

.faq-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 168, 76, 0.08);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.faq-item.active .faq-icon {
  background: rgba(201, 168, 76, 0.15);
  transform: scale(1.05);
}

.faq-text {
  flex: 1;
  text-align: right;
  line-height: 1.5;
}

.faq-toggle {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--primary);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.08);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
  background: var(--primary);
  color: #0f172a;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
  max-height: 600px;
}

.faq-answer-inner {
  padding: 0 24px 24px 24px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.85;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 18px;
  margin-top: 0;
}

.faq-answer-inner p {
  margin-bottom: 8px;
}

.faq-answer-inner strong {
  color: var(--primary-light);
  font-weight: 700;
}

.faq-answer-inner a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  transition: opacity 0.2s ease;
}

.faq-answer-inner a:hover {
  opacity: 0.8;
}

.faq-answer-inner ul {
  list-style: none;
}

/* ═══════════════════════════════════════════════
   قسم CTA النهائي
═══════════════════════════════════════════════ */
.cta-section {
  position: relative;
  z-index: 1;
  padding: 100px 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(201,168,76,0.05), transparent);
  border-top: 1px solid var(--border);
}

.cta-box {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  box-shadow: var(--shadow);
}

.cta-box h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 900;
  margin-bottom: 12px;
}

.cta-box p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 1rem;
}

/* ═══════════════════════════════════════════════
   Footer
═══════════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
  text-align: center;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.25s ease;
}

.footer-links a:hover { color: var(--primary); }

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.social-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.social-btn:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.3);
  color: var(--primary);
  transform: translateY(-3px);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ═══════════════════════════════════════════════
   📱 Sticky CTA Bar للموبايل
═══════════════════════════════════════════════ */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(201, 168, 76, 0.2);
  padding: 12px 16px;
  display: none;
  gap: 10px;
  align-items: center;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.sticky-cta-whatsapp {
  background: var(--whatsapp);
  color: white;
  flex: 0 0 auto;
  min-width: 120px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.sticky-cta-whatsapp:active {
  transform: scale(0.96);
}

.sticky-cta-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.35);
}

.sticky-cta-primary:active {
  transform: scale(0.97);
}

/* ═══════════════════════════════════════════════
   حالة التحميل والخطأ
═══════════════════════════════════════════════ */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(201,168,76,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.error-state {
  text-align: center;
  padding: 40px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.15);
  grid-column: 1 / -1;
}

/* بطاقة هيكل Skeleton للتحميل */
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.skeleton-image {
  height: 180px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-body {
  padding: 20px;
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 10px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════
   Animations
═══════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 100px 16px 60px; }
  .hero-stats { gap: 24px; }
  .cards-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 16px; }
  .testimonial-card { flex: 0 0 300px; }
  .features-grid { grid-template-columns: 1fr; }

  /* تفعيل sticky CTA على الموبايل فقط */
  .sticky-cta { display: flex; }

  /* إفساح مساحة في الأسفل للـ sticky CTA */
  body { padding-bottom: 80px; }

  /* تكييف الفلاتر للموبايل */
  .filters-wrapper { padding: 16px; }
  .filters-top { gap: 8px; }
  .search-box { min-width: 100%; order: 1; }
  .category-select { flex: 1; }
  .filter-chip { padding: 8px 14px; font-size: 0.82rem; }
  .filter-chips { gap: 8px; }

  /* FAQ على الموبايل */
  .faq-question { padding: 16px 18px; font-size: 0.93rem; gap: 10px; }
  .faq-icon { width: 36px; height: 36px; font-size: 1.2rem; }
  .faq-answer-inner { padding: 16px 18px 20px; font-size: 0.88rem; }
}

@media (max-width: 480px) {
  .overall-rating { padding: 12px 18px; }
  .overall-rating-stars { gap: 8px; }
  .stars-display.large .star { width: 18px; height: 18px; }
  .overall-rating-number strong { font-size: 1.25rem; }

  .sticky-cta-whatsapp { min-width: auto; padding: 12px 14px; }
  .sticky-cta-whatsapp span:not([aria-hidden]) { display: none; }
}

/* ═══════════════════════════════════════════════
   Scroll indicator
═══════════════════════════════════════════════ */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  animation: bounce 2s infinite;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.scroll-indicator svg {
  width: 24px; height: 24px;
  stroke: var(--primary);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ═══════════════════════════════════════════════
   Accessibility - تقليل الحركة لمن يفضل
═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════
   📎 إضافات على styles.css — ألصق هذا في نهاية الملف
   ─────────────────────────────────────────────────────────── */

/* ⭐ بطاقة مصدر مميزة */
.resource-card.featured {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.2), var(--shadow-glow);
  position: relative;
}
.resource-card.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.08), transparent 40%);
  pointer-events: none;
  border-radius: var(--radius);
}

/* نجمة المميز */
.card-featured {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: var(--bg-dark);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(201,168,76,0.4);
  z-index: 2;
}

/* وسم Tag على البطاقة (جديد/حصري/الأكثر طلباً) */
.card-tag {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(34,201,122,0.4);
}

/* عدد المشاهدات */
.card-views {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-right: 8px;
}

/* زر مشاركة عبر واتساب */
.resource-card {
  position: relative; /* مهم لزر المشاركة */
}
.card-share {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.9);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  z-index: 3;
  backdrop-filter: blur(8px);
}
.resource-card:hover .card-share {
  opacity: 1;
  transform: scale(1);
}
.card-share:hover {
  background: var(--whatsapp);
  transform: scale(1.1);
}

/* تحسين بطاقة التقييم: صورة شخصية حقيقية */
.testimonial-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* مدرسة/محافظة الطالب */
.testimonial-school {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 6px;
}

/* تاريخ التقييم */
.testimonial-date {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: left;
}

/* تحسين Loading State → Skeleton */
@keyframes skeletonShimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.skeleton-card .skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: skeletonShimmer 1.4s infinite linear;
  border-radius: 6px;
}
.skeleton-img    { height: 180px; border-radius: 0; }
.skeleton-text   { height: 12px; margin: 12px 16px; }
.skeleton-text.w-full { width: calc(100% - 32px); }
.skeleton-text.w-70   { width: 70%; }
.skeleton-text.w-50   { width: 50%; }

/* meta في الفوتر */
.footer-meta {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

/* تحسين علامة "ضعيف" — إخفاء البطاقات بسلاسة */
.resource-card.hidden-by-filter {
  display: none;
}

/* تباعد card-link لو فيه أزرار overlay */
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════
   🗓️ قسم الأحداث والفعاليات — CSS كامل
   (الكلاسات تُحقَن بواسطة buildEventCard() في app.js)
═══════════════════════════════════════════════ */

/* شبكة الأحداث */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* بطاقة حدث واحد */
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.event-card:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 168, 76, 0.3);
  box-shadow: var(--shadow-glow);
}

.event-card:hover::before {
  opacity: 1;
}

/* صف العلوي: أيقونة + meta */
.event-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* دائرة الأيقونة */
.event-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
  border: 1px solid rgba(201, 168, 76, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* حاوية التسميات (نوع + حالة) */
.event-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* وسم نوع الحدث (exam / review / announcement …) */
.event-type-tag {
  display: inline-block;
  background: rgba(201, 168, 76, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(201, 168, 76, 0.2);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

/* شارة الحالة — مشتركة */
.event-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-upcoming {
  background: rgba(201, 168, 76, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(201, 168, 76, 0.25);
}

.status-active {
  background: rgba(34, 201, 122, 0.12);
  color: #22c97a;
  border: 1px solid rgba(34, 201, 122, 0.3);
  animation: pulse 2s infinite;
}

.status-ended {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* عنوان الحدث */
.event-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.45;
  margin: 0;
}

/* وصف الحدث */
.event-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* فوتر البطاقة: تاريخ + رابط */
.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

/* التاريخ */
.event-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* رابط "تفاصيل أكثر" */
.event-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(201, 168, 76, 0.25);
  background: rgba(201, 168, 76, 0.06);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.event-link-btn:hover {
  background: rgba(201, 168, 76, 0.14);
  border-color: var(--primary);
  transform: translateX(-3px); /* RTL: move right on hover */
}

/* Responsive */
@media (max-width: 768px) {
  .events-grid {
    grid-template-columns: 1fr;
  }

  .event-card {
    padding: 18px;
    gap: 12px;
  }

  .event-icon-wrap {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    border-radius: 12px;
  }

  .event-title {
    font-size: 0.97rem;
  }
}

/* ═══════════════════════════════════════════════
   ⬆️ زر الصعود لأعلى
═══════════════════════════════════════════════ */
.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 95;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0f172a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  pointer-events: none;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  box-shadow: 0 6px 28px rgba(201, 168, 76, 0.55);
  transform: translateY(-3px) scale(1.08);
}

.scroll-top-btn:active {
  transform: scale(0.95);
}

.scroll-top-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

@media (max-width: 768px) {
  .scroll-top-btn {
    bottom: 90px; /* فوق sticky CTA */
    left: 16px;
    width: 44px;
    height: 44px;
  }
}