/* خطوط عصرية تدعم العربية واللاتينية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Poppins:wght@400;600;700&display=swap');

/* ========== أساسيات وثيمينغ ========== */
:root{
  --bg: #0f0f0f;
  --bg-2: #1a1a1a;
  --card: rgba(255,255,255,0.03);
  --text: #f7f7f7;
  --muted: #cfcfcf;
  --primary: #1e90ff;
  --primary-2: #63b3ff;
  --border: #2a2a2a;
  --shadow: rgba(0,0,0,0.5);
}

.light-mode{
  --bg: #f8f9fb;
  --bg-2: #ffffff;
  --card: #ffffff;
  --text: #1c1c1c;
  --muted: #555;
  --primary: #0066cc;
  --primary-2: #004c99;
  --border: #e7e7e7;
  --shadow: rgba(0,0,0,0.1);
}

/* ========== الهيكل العام ========== */
html,body{
  height: 100%;
}

body {
  font-family: "Poppins","Cairo",sans-serif;
  background: linear-gradient(135deg, var(--bg), var(--bg-2));
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.65;
  transition: background 0.35s ease, color 0.35s ease;
}

/* شريط تقدم التمرير */
#scrollProgress{
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  z-index: 9999;
}

/* هيدر ثابت خفيف */
.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(20,20,20,0.6);
  backdrop-filter: blur(8px);
}

/* في الوضع الفاتح */
.light-mode .site-header{
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
}

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 15px;
}

.lang-switch button{
  margin: 0 5px;
  padding: 6px 12px;
  cursor: pointer;
  background: #222;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, background 0.3s;
}
.light-mode .lang-switch button{ background: #f0f0f0; color: #111; }
.lang-switch button:hover{ transform: translateY(-2px); background: var(--primary); color: #fff; }

/* زر الثيم */
.theme-toggle{
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s ease, background .3s ease;
}
.theme-toggle:hover{ transform: translateY(-2px); }

/* ========== قسم البارالاكس ========== */
.hero{
  background: radial-gradient(1200px 600px at 50% -10%, rgba(30,144,255,0.25), transparent),
              radial-gradient(900px 500px at 90% 20%, rgba(255,255,255,0.08), transparent);
  border-bottom: 1px solid var(--border);
}
.parallax{
  background-attachment: fixed;
}
.hero-inner{
  max-width: 900px;
  margin: 0 auto;
  padding: 38px 16px 46px;
  text-align: center;
}
.hero-inner h1{
  margin: 0 0 10px;
  font-size: 2rem;
  font-weight: 700;
}
.hero-inner p{
  margin: 0 auto 12px;
  color: var(--muted);
  max-width: 820px;
}
.hero-icons{
  display: flex; gap: 14px; justify-content: center; font-size: 1.25rem; opacity: .9;
}

/* ========== الحاوية الرئيسية ========== */
main{
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 15px 60px;
}
section{ margin: 44px 0; }

/* العناوين */
section h2{
  margin: 0 0 18px;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* بطاقات عامة */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 16px var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.card:hover{ transform: translateY(-6px); }

/* نصوص ثانوية */
.project-description p,
.video-thumb p,
.school p{ color: var(--muted); }

/* ========== الفيديوهات الرئيسية ========== */
.main-videos-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.video-thumb{
  text-align: center;
  padding: 10px;
}
.thumb-wrap{
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.thumb-wrap img{
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
  transition: transform .35s ease, filter .35s ease, border-color .35s ease;
}
.play-overlay{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  font-size: 1.8rem;
  background: linear-gradient(180deg, rgba(0,0,0,.0), rgba(0,0,0,.35));
}
.video-thumb:hover img{ transform: scale(1.06); filter: brightness(1.15); border-color: var(--primary); }
.video-thumb:hover .play-overlay{ opacity: 1; }

/* ========== شبكة المدارس ========== */
.schools-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.school{
  padding: 14px;
}
.school h3{
  margin: 6px 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
}
.school p{
  margin: 0 0 10px;
  font-size: .95rem;
  line-height: 1.5;
}
.thumb-wrap.small img{
  height: 160px;
}
.video-link .thumb-wrap img{
  box-shadow: 0 4px 12px var(--shadow);
}

/* ========== الإحصائيات ========== */
.stats-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.stat{
  text-align: center;
  padding: 18px 12px;
}
.stat .number{
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}
.stat .label{
  margin-top: 6px; color: var(--muted);
}

/* ========== FAQ (Accordion) ========== */
.accordion details{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.accordion summary{
  cursor: pointer;
  font-weight: 600;
  outline: none;
}
.accordion p{ color: var(--muted); margin: 8px 0 0; }

/* ========== فوتر ========== */
footer{
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px 15px;
}
footer .wallet-title{
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}
footer .wallet-note{
  color: var(--muted);
}

/* ========== زر رجوع للأعلى ========== */
.back-to-top{
  position: fixed;
  right: 16px;
  bottom: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 6px 16px var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.back-to-top.show{ opacity: 1; visibility: visible; transform: translateY(0); }

/* ========== استجابة الهواتف ========== */
@media (max-width: 768px){
  section h2{ font-size: 1.35rem; }
  .thumb-wrap img{ height: 190px; }
  .thumb-wrap.small img{ height: 170px; }
  .topbar{ padding: 10px 12px; }
}

/* دعم الاتجاه RTL */
html[dir="rtl"]{ direction: rtl; }
html[dir="rtl"] body{ text-align: right; }
html[dir="rtl"] .lang-switch{ text-align: left; }

/* ========== حركات الظهور ========== */
.reveal{ opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible{ opacity: 1; transform: none; }
