/* ============================================================
   قلم أحمر — ستايل الصفحة التعريفية (Landing Page)
   بيتحمّل في index.html بس، بعد main.css.

   ليه ملف منفصل مش جوّه main.css؟
   main.css بيتحمّل في كل صفحة في المشروع (20+ صفحة)، والستايل ده
   بيخص صفحة واحدة بس. لو اتحط هناك كان كل مدرس بيفتح لوحته هيحمّل
   ~9 كيلو ستايل عمره ما هيستخدمه.

   كل الألوان والقياسات جاية من متغيّرات main.css (--primary, --surface,
   --radius...)، فالوضع الداكن بيشتغل هنا لوحده من غير أي تكرار.

   ⚠️ الاتجاه: الصفحة بتشتغل عربي (RTL) وإنجليزي (LTR) بنفس الكود،
   فكل الخصائص الاتجاهية هنا منطقية (inline-start / inline-end /
   text-align: start) مش (left / right). أي `left` أو `right` هنا
   معناها الصفحة هتتكسر في اللغة التانية.
   ============================================================ */

/* ---------- 0. أساسيات الصفحة ---------- */

/* التمرير الناعم لما المستخدم يضغط على لينك في القايمة (#features مثلًا).
   scroll-padding-top بيمنع الهيدر اللاصق إنه يغطّي عنوان القسم بعد
   القفزة — من غيرها القسم بيقف تحت الهيدر بالظبط ومش باين. */
html.landing {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
@media (prefers-reduced-motion: reduce) {
  html.landing { scroll-behavior: auto; }
}

/* body في main.css متظبّط للوحات الداخلية (خلفية رمادية). الصفحة
   التعريفية محتاجة خلفية بيضا نضيفة عشان الأقسام تتناوب فوقها. */
body.landing {
  background: var(--surface);
}

.landing-container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- 1. الهيدر اللاصق ---------- */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* المتصفحات القديمة اللي مش فاهمة color-mix هتتجاهل السطر فوق وتسيب
   الهيدر شفاف تمامًا (النص هيتلخبط مع المحتوى وهو بيتمرّر تحته).
   @supports بيدّيها خلفية صلبة بدل كده. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .landing-header { background: var(--surface); }
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.landing-brand {
  font-size: 21px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}
.landing-links a:hover { color: var(--primary); }

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* زرار "دخول" في الهيدر أصغر من أزرار الصفحة العادية */
.landing-header .btn { padding: 9px 18px; font-size: 14px; }

/* على الموبايل بنخفي روابط الأقسام بس — أزرار الدخول/التسجيل بتفضل،
   لأنها الحاجة الوحيدة اللي المدرس الراجع محتاجها من الهيدر.
   القايمة المنسدلة (hamburger) مش مستحقة هنا: 3 لينكات بتوصلهم
   بالتمرير العادي في ثانيتين. */
@media (max-width: 720px) {
  .landing-links { display: none; }
  .landing-nav { height: 60px; }
  .landing-brand { font-size: 19px; }
}

/* ---------- 2. الهيرو ---------- */
.hero {
  padding-block: 56px 64px;
  /* تدرّج خفيف جدًا بلون الهوية عشان أول شاشة ما تبقاش بيضا صريحة */
  background:
    radial-gradient(circle at 85% 0%, var(--primary-lighter), transparent 55%),
    var(--surface);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

/* شارة التجربة المجانية فوق العنوان */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 56ch;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.hero-actions .btn { padding: 14px 28px; font-size: 16px; }

.hero-note {
  font-size: 13.5px;
  color: var(--text-light);
}

/* زرار "ثبّت التطبيق" — بيتحقن من js/shared/install-app.js.
   الخانة (.hero-install) بتفضل فاضية على المتصفحات اللي مش بتدعم
   التثبيت، وmargin-top بيتحط على الزرار نفسه مش على الخانة عشان
   ماتسيبش فراغ وهي فاضية. */
.hero-install .install-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.hero-install .install-btn:hover {
  border-color: var(--primary);
  border-style: solid;
  color: var(--primary);
  background: var(--primary-lighter);
}
.hero-install .install-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* كارت الدخول جوّه الهيرو.
   .auth-card جاي من main.css (خلفية + ظل + max-width 400px)، وإحنا
   بنزوّد عليه إطار بس عشان يبان فوق خلفية الهيرو الفاتحة. */
.hero-login {
  display: flex;
  justify-content: center;
}
.hero-login .auth-card {
  border: 1px solid var(--border);
  padding: 28px 26px;
  margin: 0;
}
.hero-login .auth-logo { font-size: 20px; margin-bottom: 4px; }
.hero-login .auth-subtitle { font-size: 13px; margin-bottom: 20px; }

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero { padding-block: 36px 44px; }
  .hero-sub { font-size: 16px; }
  .hero-login .auth-card { max-width: 440px; }
}

/* ---------- 3. الأقسام العامة ---------- */
.section {
  padding-block: 68px;
  border-top: 1px solid var(--border);
}
/* قسم بخلفية مختلفة شوية عشان الأقسام تتناوب وما تبقاش لوح واحد */
.section-alt { background: var(--bg); }

.section-head {
  text-align: center;
  max-width: 62ch;
  margin-inline: auto;
  margin-bottom: 44px;
}
.section-head h2 {
  font-size: clamp(24px, 3.2vw, 33px);
  font-weight: 700;
  margin-bottom: 12px;
}
.section-head p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
}

@media (max-width: 720px) {
  .section { padding-block: 46px; }
  .section-head { margin-bottom: 30px; }
}

/* ---------- 4. المميزات ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
@media (prefers-reduced-motion: no-preference) {
  .feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  }
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  font-size: 22px;
  margin-bottom: 16px;
  /* اللون بيتحدّد من data-tone على الكارت نفسه — تحت */
  background: var(--primary-light);
}

.feature-card h3 {
  font-size: 17.5px;
  font-weight: 700;
  margin-bottom: 9px;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ألوان الأيقونات — بتستخدم الألوان المساعدة اللي أصلاً معرّفة في
   main.css وبتقلب لوحدها في الوضع الداكن */
.feature-card[data-tone="blue"]   .feature-icon { background: var(--blue-light); }
.feature-card[data-tone="green"]  .feature-icon { background: var(--green-light); }
.feature-card[data-tone="orange"] .feature-icon { background: var(--orange-light); }
.feature-card[data-tone="purple"] .feature-icon { background: var(--purple-light); }

/* شريط المميزات الصغيرة تحت الكروت */
.feature-extras {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.feature-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
}

/* ---------- 5. خطوات البدء ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
}

/* رقم الخطوة — counter مش رقم مكتوب في الـ HTML، عشان لو اتضافت
   خطوة أو اتشالت الترقيم يظبط لوحده (وعشان قارئ الشاشة ما يقراش
   رقم مكرر مع نص العنوان) */
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -16px;
  inset-inline-start: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 16px;
}

.step h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 9px;
  margin-top: 6px;
}
.step p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ---------- 6. شريط الطالب ----------
   ⚠️ مفيش ستايلات أسعار في الملف ده بالقصد — قسم الأسعار اتشال من
   الصفحة بالكامل عشان الطلاب بيمرّوا على نفس الصفحة. الشرح الكامل
   في CLAUDE.md وفي تعليق الشريط في index.html. */
.student-strip {
  background: var(--blue-light);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

/* بنستهدف .landing-container الجوّاني عشان الشريط نفسه ياخد عرض
   الشاشة كامل بينما النص يفضل محاذي لباقي أقسام الصفحة */
.student-strip .landing-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-block: 9px;
}

.student-strip a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.student-strip a:hover { color: var(--primary-dark); }
.student-strip a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (max-width: 560px) {
  .student-strip { font-size: 13px; }
  .student-strip .landing-container { gap: 6px; }
}

/* ---------- 6b. زرار تبديل الدور (مدرس / طالب) ----------
   بيقعد فوق حقل الإيميل جوّه كارت الدخول. مش أزرار بتبدّل محتوى —
   دول لينكات بتنقل بين صفحتي الهبوط (index.html / student.html)،
   عشان كل صفحة تفضل خفيفة ومحتواها ليها لوحدها. */
.role-switch {
  display: flex;
  gap: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 18px;
}

.role-switch a {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background .18s ease, color .18s ease;
}
.role-switch a:hover { color: var(--text); }

/* الدور الحالي. aria-current="page" هو المصدر — مش كلاس منفصل —
   عشان قارئ الشاشة يعرف إحنا في أنهي صفحة، والستايل يتبعه. */
.role-switch a[aria-current="page"] {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.role-switch a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* ---------- 6c. شرح تثبيت التطبيق ----------
   المحتوى بيتحقن من js/shared/install-guide.js */
.ig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.ig-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  text-align: center;
}

.ig-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* الرسمة بتاخد لونها من هنا: currentColor جوّه الـ SVG بيورّث
   الـ color ده، وvar(--primary) بتوصلها من الجذر */
.ig-art {
  color: var(--text-light);
  margin-bottom: 14px;
}
.ig-art svg {
  width: 100%;
  max-width: 96px;
  height: auto;
  display: block;
  margin-inline: auto;
}

/* الخطوات مرقّمة تلقائيًا بـ <ol>. counter مخصص بدل الترقيم
   الافتراضي عشان الرقم ياخد لون الهوية ويفضل ملزّق للنص في RTL. */
.ig-steps {
  list-style: none;
  counter-reset: ig-step;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.ig-steps li {
  counter-increment: ig-step;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}
.ig-steps li::before {
  content: counter(ig-step);
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* زرار "شوف الصور" — بيظهر بس للمنصات اللي عندها صور فعلاً
   (SCREENSHOTS في install-guide.js) */
.ig-shots-btn {
  width: 100%;
  margin-bottom: 14px;
  padding: 9px 14px;
  background: var(--primary-light);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
  transition: background .18s ease;
}
.ig-shots-btn:hover { background: color-mix(in srgb, var(--primary) 18%, var(--primary-light)); }
.ig-shots-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.ig-note {
  font-size: 12.5px;
  color: var(--text-light);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  text-align: start;
}

/* ---------- معرض الصور ----------
   الطبقة بتتحقن في <body> من install-guide.js عند أول فتح.
   ⚠️ الخلفية سودا ثابتة (مش var): الصور بتتعرض فوقها في الوضعين،
   ولون السطح الفاتح كان هيبهّت حواف صور الشاشة البيضا. */
.ig-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(3px);
}

.ig-lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  max-height: 100%;
}

/* صور الشاشات طولية (موبايل)، فبنحدّ الارتفاع مش العرض — من غير
   كده صورة الآيفون كانت بتطلع أطول من الشاشة وتحتاج تمرير */
.ig-lb-figure img {
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.ig-lb-figure figcaption {
  color: #fff;
  font-size: 14.5px;
  text-align: center;
  max-width: 42ch;
  line-height: 1.7;
}

/* أزرار التنقل والقفل — ألوانها ثابتة عشان فوق خلفية سودا دايمًا */
.ig-lb-nav,
.ig-lb-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  transition: background .18s ease;
}
.ig-lb-nav:hover,
.ig-lb-close:hover { background: rgba(255, 255, 255, .3); }
.ig-lb-nav:focus-visible,
.ig-lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.ig-lb-nav {
  width: 46px;
  height: 46px;
  font-size: 30px;
  line-height: 1;
}

/* الأسهم رموز لاتينية، فبتتقلب غلط في RTL — بنجبرها على اتجاه ثابت
   وبنعكس ترتيب الزرارين بدل ما نعكس رسمهم */
.ig-lb-nav { direction: ltr; }
[dir="rtl"] .ig-lb-prev { order: 3; }
[dir="rtl"] .ig-lb-next { order: 1; }

.ig-lb-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  font-size: 19px;
}

@media (max-width: 640px) {
  .ig-lightbox { padding: 12px; gap: 4px; }
  .ig-lb-nav { width: 38px; height: 38px; font-size: 25px; }
  .ig-lb-figure img { max-height: 66vh; }
  .ig-lb-figure figcaption { font-size: 13.5px; }
}

.ig-footnote {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ---------- 7. الأسئلة الشائعة ---------- */
/* أكورديون بـ <details> — من غير أي جافاسكريبت، وبيشتغل مع البحث
   داخل الصفحة (Ctrl+F) في المتصفحات الحديثة */
.faq {
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq details[open] { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }

.faq summary {
  padding: 17px 20px;
  font-weight: 600;
  font-size: 15.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}
/* إخفاء السهم الافتراضي (كل متصفح بيرسمه بشكل مختلف ومكانه بيتلخبط في RTL) */
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ""; }

/* السهم بتاعنا — بيلف لما السؤال يتفتح */
.faq summary::after {
  content: "⌄";
  flex-shrink: 0;
  font-size: 18px;
  color: var(--primary);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(180deg); }

.faq summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.faq-answer {
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.9;
}

/* ---------- 8. نداء أخير ---------- */
.cta-band {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding-block: 60px;
}
.cta-band h2 {
  font-size: clamp(23px, 3vw, 31px);
  font-weight: 700;
  margin-bottom: 12px;
}
.cta-band p {
  font-size: 16px;
  opacity: .93;
  margin-bottom: 26px;
  max-width: 52ch;
  margin-inline: auto;
  line-height: 1.8;
}
/* زرار أبيض فوق الخلفية الحمرا. مش بنستخدم .btn-primary هنا لأن
   لونه هو نفس لون الخلفية — الزرار كان هيختفي.
   ⚠️ اللونين ثابتين بالقصد (مش var): الشريط أحمر في الوضعين، فلو
   استخدمنا var(--surface) الزرار كان هيبقى رمادي غامق على أحمر
   في الوضع الداكن. */
.cta-band .btn-invert {
  background: #fff;
  color: #c0392b;
  padding: 14px 32px;
  font-size: 16px;
}
.cta-band .btn-invert:hover { background: #f4f5f7; }
.cta-band .btn-invert:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- 9. الفوتر ---------- */
.landing-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-block: 34px;
  /* مساحة زيادة تحت: زراري الثيم واللغة العايمين (theme.js / i18n.js)
     بيقعدوا fixed في الركن السفلي وكانوا بيقعدوا فوق نص الفوتر */
  padding-bottom: 96px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-links a:hover { color: var(--primary); }

@media (max-width: 560px) {
  .footer-inner { justify-content: center; text-align: center; }
}
