/* ============================================================
   CHARKI Courses — Premium Dark UI (Glassmorphism & Purple Neon)
============================================================ */

:root {
  --bg-color:      #05030A;
  --surface:       rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.06);
  
  --purple-main:   #8B5CF6;
  --purple-glow:   rgba(139, 92, 246, 0.4);
  --purple-dark:   rgba(88, 28, 135, 0.5);
  
  --white:         #FFFFFF;
  --muted:         #A1A1AA;

  --font-display:  'Alexandria', sans-serif;
  --font-body:     'Cairo', sans-serif;

  --radius:        20px;
  --radius-pill:   999px;
  --transition:    all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; direction: rtl; text-align: right; }

body {
  background-color: var(--bg-color);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; border: none; background: none; outline: none; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; margin: 0; }

::selection { background: var(--purple-main); color: var(--white); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--purple-main); }

/* Backgrounds & Glassmorphism */
.bg-noise {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}
.bg-glow { position: fixed; z-index: -1; border-radius: 50%; filter: blur(120px); pointer-events: none; }
.bg-glow-top { width: 50vw; height: 50vw; top: -20vw; right: -10vw; background: radial-gradient(circle, var(--purple-dark), transparent 60%); }
.bg-glow-bottom { width: 60vw; height: 60vw; bottom: -20vw; left: -20vw; background: radial-gradient(circle, rgba(37,99,235,0.2), transparent 60%); }

.glass-panel {
  background: rgba(15, 10, 25, 0.4); 
  backdrop-filter: blur(20px); 
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border); 
  border-radius: var(--radius);
}

/* Utils & Ripple */
.section-padding { padding: 80px 20px; max-width: 1400px; margin: 0 auto; }
.text-gradient { background: linear-gradient(135deg, #DDD6FE 0%, #8B5CF6 100%); -webkit-background-clip: text; color: transparent; text-shadow: 0 0 20px var(--purple-glow); }

.ripple-btn { position: relative; overflow: hidden; cursor: pointer; }
.ripple-effect {
  position: absolute; border-radius: 50%; transform: scale(0);
  animation: ripple-anim 0.6s linear; background: rgba(255, 255, 255, 0.2); pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* Shared Section Headers */
.section-header { margin-bottom: 50px; }
.section-badge {
  display: inline-block; background: rgba(139, 92, 246, 0.1); border: 1px solid var(--purple-main);
  color: #DDD6FE; padding: 6px 16px; border-radius: var(--radius-pill); font-size: 13px;
  font-family: var(--font-display); font-weight: 700; margin-bottom: 16px; box-shadow: 0 0 10px var(--purple-glow);
}
.section-title { font-size: clamp(28px, 4vw, 40px); color: var(--white); margin-bottom: 12px; }
.section-subtitle { color: var(--muted); font-size: 16px; max-width: 600px; margin: 0 auto; }

/* HEADER & NAVBAR */
.site-header { position: sticky; top: 0; z-index: 1000; height: 80px; display: flex; align-items: center; background: rgba(5, 3, 10, 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 24px; color: var(--white); text-transform: uppercase; letter-spacing: -1px; }

/* Navigation Links (Desktop) */
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-link-item { color: var(--muted); font-weight: 700; font-size: 15px; font-family: var(--font-display); transition: var(--transition); position: relative; }
.nav-link-item:hover { color: var(--white); text-shadow: 0 0 10px var(--purple-glow); }
.nav-link-item::after { content: ''; position: absolute; bottom: -4px; right: 0; width: 0; height: 2px; background: var(--purple-main); transition: var(--transition); border-radius: var(--radius-pill); }
.nav-link-item:hover::after { width: 100%; }

/* Mobile Quick Nav Scroller */
.mobile-quick-nav { background: rgba(5, 3, 10, 0.95); border-bottom: 1px solid var(--border); padding: 10px 0; position: sticky; top: 80px; z-index: 99; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
.quick-nav-scroller { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding: 0 10px; }
.quick-nav-scroller::-webkit-scrollbar { display: none; }
.quick-nav-item { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: 6px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; white-space: nowrap; transition: var(--transition); flex-shrink: 0; }
.quick-nav-item:hover { color: var(--white); border-color: var(--purple-main); background: rgba(139, 92, 246, 0.1); }

.header-actions { display: flex; gap: 12px; }
.btn-contact { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--border); transition: var(--transition); }
.btn-whatsapp { background: rgba(37, 211, 102, 0.1); color: #25D366; border-color: rgba(37, 211, 102, 0.3); }
.btn-telegram { background: rgba(0, 136, 204, 0.1); color: #0088cc; border-color: rgba(0, 136, 204, 0.3); }
.btn-whatsapp:hover { background: #25D366; color: #fff; box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4); }
.btn-telegram:hover { background: #0088cc; color: #fff; box-shadow: 0 5px 20px rgba(0, 136, 204, 0.4); }

.mobile-floating-contacts { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 12px; }
.float-btn { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.float-wa { background: #25D366; }
.float-tg { background: #0088cc; }

/* HERO */
.hero { padding: 80px 20px 40px; text-align: center; }
.hero-title { font-size: clamp(32px, 5vw, 64px); line-height: 1.2; max-width: 900px; margin: 0 auto 20px; }
.hero-subtitle { font-size: clamp(16px, 2vw, 20px); color: var(--muted); max-width: 600px; margin: 0 auto; }

/* STATS */
.stats-section { padding: 0 20px 40px; max-width: 1400px; margin: 0 auto; }
.stats-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 20px; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card { padding: 30px; text-align: center; transition: var(--transition); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-card:hover { transform: translateY(-5px); border-color: var(--purple-main); box-shadow: 0 10px 30px var(--purple-glow); }
.stat-number { font-size: 36px; margin-bottom: 8px; }
.stat-text { color: var(--muted); font-weight: 700; font-size: 15px; margin: 0; }

/* COURSES SEARCH & CATEGORIES */
.search-box { display: flex; align-items: center; gap: 12px; max-width: 600px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 12px 24px; transition: var(--transition); }
.search-box:focus-within { border-color: var(--purple-main); box-shadow: 0 0 20px var(--purple-glow); background: rgba(0,0,0,0.5); }
.search-box i { color: var(--muted); font-size: 18px; }
.search-box input { flex: 1; background: none; border: none; color: var(--white); outline: none; font-size: 16px; font-family: var(--font-body); }
.search-clear { color: var(--muted); }

.categories-scroller { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; justify-content: flex-start; max-width: 100%; padding-bottom: 5px; margin: 20px 0 40px; }
@media (min-width: 992px) { .categories-scroller { justify-content: center; flex-wrap: wrap; } }
.categories-scroller::-webkit-scrollbar { display: none; }
.category-chip { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: 10px 20px; border-radius: var(--radius-pill); font-weight: 700; font-size: 14px; white-space: nowrap; transition: var(--transition); flex-shrink: 0; }
.category-chip:hover { color: var(--white); background: var(--surface-hover); }
.category-chip.is-active { background: var(--purple-main); color: var(--white); border-color: var(--purple-main); box-shadow: 0 5px 20px var(--purple-glow); }

/* COURSES GRID (Compact Setup) */
.courses-grid { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 12px; 
}
@media (min-width: 768px) { 
  .courses-grid { 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
  } 
}
@media (min-width: 1024px) { 
  .courses-grid { 
    grid-template-columns: repeat(4, 1fr); 
    gap: 24px; 
  } 
}

.course-card { 
  background: rgba(20, 15, 30, 0.4); 
  border: 1px solid var(--border); 
  border-radius: 14px; 
  display: flex; 
  flex-direction: column; 
  height: 100%; 
  overflow: hidden; 
  backdrop-filter: blur(10px); 
  -webkit-backdrop-filter: blur(10px); /* Safari Fix */
  transition: var(--transition); 
  opacity: 0; 
  transform: translateY(20px); 
  animation: fadeUp 0.5s forwards; 
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.course-card:hover { 
  transform: translateY(-3px); 
  border-color: var(--purple-main); 
  box-shadow: 0 8px 25px var(--purple-glow); 
}

.course-card-media { 
  position: relative; 
  width: 100%; 
  aspect-ratio: 16/9; /* Keeps image short and wide */
  overflow: hidden; 
  border-radius: 14px 14px 0 0; 
}
.course-card-media img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  transition: transform 0.5s ease; 
}
.course-card:hover .course-card-media img { transform: scale(1.05); }

.course-badge-vip { 
  position: absolute; 
  top: 6px; 
  right: 6px; 
  background: rgba(0,0,0,0.7); 
  backdrop-filter: blur(4px); 
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--purple-main); 
  color: var(--white); 
  padding: 2px 8px; 
  border-radius: var(--radius-pill); 
  font-size: 10px; 
  font-weight: 800; 
}

.course-card-body { 
  padding: 10px 8px; 
  display: flex; 
  flex-direction: column; 
  flex: 1; 
  justify-content: space-between; 
  gap: 8px; 
}

.course-card-name { 
  font-size: 13px; /* Slightly bigger for readability, still compact */
  font-weight: 700; 
  color: var(--white); 
  text-align: center; 
  display: -webkit-box; 
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical; 
  overflow: hidden; 
  line-height: 1.4; 
  margin: 0; 
}

/* === إخفاء اسم المدرب باش البطاقة تبقى قصيرة === */
.course-card-instructor { display: none; }

.btn-details { 
  background: var(--surface); 
  border: 1px solid var(--border); 
  color: var(--white); 
  padding: 6px 10px; 
  border-radius: var(--radius-pill); 
  font-size: 12px; 
  font-weight: 700; 
  transition: var(--transition); 
  display: block; 
  width: 100%; 
  text-align: center; 
  margin-top: auto; 
}
.course-card:hover .btn-details { 
  background: var(--purple-main); 
  border-color: var(--purple-main); 
  box-shadow: 0 0 10px var(--purple-glow); 
}

.btn-action { background: var(--purple-main); color: #fff; font-size: 16px; font-weight: 800; font-family: var(--font-display); padding: 14px 36px; border-radius: var(--radius-pill); box-shadow: 0 10px 30px var(--purple-glow); transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border:none; margin-top: 20px;}
.btn-action:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(139, 92, 246, 0.6); color: #fff; }

/* Skeletons */
.skeleton-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 14px; height: 100%; display: flex; flex-direction: column; }
.skeleton-anim { background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-img { width: 100%; aspect-ratio: 16/9; border-radius: 14px 14px 0 0; }
.skeleton-body { padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.skeleton-line { height: 12px; border-radius: 4px; width: 80%; }
.skeleton-line.short { width: 40%; height: 8px; }
.skeleton-btn { width: 100%; height: 28px; border-radius: var(--radius-pill); margin-top: auto; }

/* FEATURES (Why Us) */
.features-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 20px; }
@media (min-width: 768px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card { padding: 40px 30px; text-align: center; transition: var(--transition); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feature-card:hover { transform: translateY(-5px); border-color: var(--purple-main); box-shadow: 0 10px 30px var(--purple-glow); }
.feature-icon { width: 60px; height: 60px; background: rgba(139, 92, 246, 0.1); border: 1px solid var(--purple-main); color: #DDD6FE; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 20px; box-shadow: 0 0 15px var(--purple-glow); }
.feature-title { font-size: 20px; margin-bottom: 12px; }
.feature-text { color: var(--muted); font-size: 15px; margin: 0; }

/* TESTIMONIALS */
.testimonials-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 20px; }
@media (min-width: 768px) { .testimonials-grid { grid-template-columns: repeat(3, 1fr); } }
.review-card { padding: 30px; transition: var(--transition); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.review-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.15); }
.review-stars { color: #F59E0B; margin-bottom: 16px; font-size: 14px; letter-spacing: 2px; }
.review-text { font-size: 15px; color: var(--white); font-style: italic; margin-bottom: 24px; line-height: 1.7; }
.review-client { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--border); padding-top: 20px; }
.client-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #8B5CF6, #3B82F6); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; color: #fff; }
.client-info h4 { font-size: 16px; margin-bottom: 4px; }
.client-info span { font-size: 13px; color: var(--muted); }

/* FAQ */
.faq-container { display: flex; flex-direction: column; gap: 16px; }
.faq-item { transition: var(--transition); overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-question { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--white); transition: var(--transition); }
.faq-question i { font-size: 18px; color: var(--purple-main); transition: transform 0.4s ease; }
.faq-answer { padding: 0 24px; max-height: 0; opacity: 0; transition: all 0.4s ease; color: var(--muted); font-size: 15px; line-height: 1.7; }
.faq-item.is-open { border-color: var(--purple-main); box-shadow: 0 5px 20px rgba(139, 92, 246, 0.15); }
.faq-item.is-open .faq-answer { padding: 0 24px 24px; max-height: 200px; opacity: 1; }
.faq-item.is-open i { transform: rotate(180deg); }

/* FINAL CTA */
.cta-inner { padding: 60px 20px; position: relative; overflow: hidden; text-align: center; border: 1px solid rgba(139, 92, 246, 0.3); box-shadow: 0 20px 60px rgba(139, 92, 246, 0.1); border-radius: var(--radius); background: var(--surface); }
.cta-inner::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 50%); z-index: 0; pointer-events: none; }
.cta-title { font-size: clamp(24px, 4vw, 36px); margin-bottom: 16px; position: relative; z-index: 1; }
.cta-subtitle { color: var(--muted); margin-bottom: 30px; font-size: 16px; position: relative; z-index: 1; }
.cta-actions { position: relative; z-index: 1; }

/* MODAL */
.course-modal .modal-content { background: rgba(10, 5, 15, 0.95); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 80px rgba(0,0,0,0.9); }
.course-modal-image { width: 100%; aspect-ratio: 16/9; background: #000; }
.course-modal-image img { width: 100%; height: 100%; object-fit: cover; }
.course-modal-content { padding: 30px; text-align: center; }
.course-modal-title { font-size: 24px; color: var(--white); margin-bottom: 8px; line-height: 1.3; }
.course-modal-instructor { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.course-modal-instructor i { color: var(--purple-main); }
.course-modal-subheading { font-size: 18px; color: var(--white); margin-bottom: 20px; text-align: right; }
.course-modal-learn { text-align: right; display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px;}
.course-modal-learn li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--muted); }
.course-modal-learn li::before { content: '✅'; font-size: 12px; margin-top: 3px; }
.btn-close-bottom { background: var(--surface); border: 1px solid var(--border); color: var(--white); font-weight: 700; padding: 12px 40px; border-radius: var(--radius-pill); font-size: 16px; transition: var(--transition); }
.btn-close-bottom:hover { background: rgba(255,0,0,0.1); border-color: red; color: #ff4d4d; }

/* FOOTER */
.site-footer { padding: 40px 20px; background: rgba(0,0,0,0.5); border-top: 1px solid var(--border); }
.footer-brand { font-size: 24px; color: var(--white); margin-bottom: 20px; letter-spacing: -1px; }
.footer-contacts { display: flex; justify-content: center; gap: 30px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-contacts a { font-size: 15px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; transition: var(--transition); }
.footer-contacts a:hover { color: var(--purple-main); }
.footer-copyright { font-size: 14px; color: var(--muted-2); margin: 0; }
/* =========================================
   Social Proof Images Section (Apple Style)
   ========================================= */
.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.sp-card {
  border-radius: 20px; 
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* الخلفية مخدومة باش تبان بحال Glass-panel اللي عندك فالسيت */
  background: rgba(255, 255, 255, 0.05); 
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.sp-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* الكلاسات المسؤولة عن الإخفاء والإظهار */
.hidden-sp {
  display: none !important;
}

.fade-in-sp {
  display: block;
  animation: fadeInSmooth 0.6s ease forwards;
}

@keyframes fadeInSmooth {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .sp-grid {
    grid-template-columns: 1fr;
  }
}