/*
Theme Name: elsakhy
Theme URI: https://elsakhy.com
Author: elsakhy
Description: قالب تذكاري للشيخ محمد محمود السخي رحمه الله — يحتوي على قوالب صفحات مستقلة (Page Templates) لكل صفحة، مع تلاوات من Google Drive، القرآن الكريم تلاوةً وتفسيرًا، المكتبة النادرة، والوضع الليلي/النهاري.
Version: 1.0
Requires at least: 5.5
Requires PHP: 7.2
Text Domain: elsakhy
*/

/* ======================================================================
   المتغيرات — الوضع الليلي (الافتراضي) — كما هو دون تغيير
   ====================================================================== */
:root {
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-dark: #8a6f2e;
  --green-deep: #0d2b1a;
  --green-mid: #1a4a2e;
  --green-light: #2d6b47;
  --cream: #f5f0e8;
  --cream-dark: #e8dfc8;
  --text-dark: #1a1208;
  --text-mid: #3d2e10;
  --shadow: rgba(0,0,0,0.4);

  /* متغيرات الشريط العلوي */
  --nav-bg-top: rgba(13,43,26,0.98);
  --nav-bg-bot: rgba(13,43,26,0.85);
  --nav-border: rgba(201,168,76,0.3);
  --nav-mobile-bg: rgba(13,43,26,0.98);
}

/* ======================================================================
   الوضع النهاري (Light Mode) — إعادة تصميم كاملة: خلفية بيضاء/فاتحة
   مع الحفاظ على الهوية الذهبية ووضوح القراءة
   ====================================================================== */
[data-theme="light"] {
  --gold: #a8812c;
  --gold-light: #8a6f2e;
  --gold-dark: #6d5622;
  --green-deep: #ffffff;
  --green-mid: #f7f2e7;
  --green-light: #efe7d3;
  --cream: #241c0d;
  --cream-dark: #4a3c1a;
  --shadow: rgba(0,0,0,0.12);

  --nav-bg-top: rgba(255,255,255,0.98);
  --nav-bg-bot: rgba(255,255,255,0.90);
  --nav-border: rgba(168,129,44,0.35);
  --nav-mobile-bg: rgba(255,255,255,0.99);
}

[data-theme="light"] body { background: #ffffff; color: #241c0d; }

[data-theme="light"] ::-webkit-scrollbar-track { background: #f0ebdd; }

/* أقسام النصوص الفاتحة التي تحتاج قلب اللون على الأبيض */
[data-theme="light"] .bio-text p { color: #3a2f16; }
[data-theme="light"] .bio-text strong { color: var(--gold-light); }
[data-theme="light"] .bio-card { background: rgba(168,129,44,0.09); border-color: rgba(168,129,44,0.25); }
[data-theme="light"] .bio-card strong { color: #241c0d; }
[data-theme="light"] .bio-card span { color: #4a3c1a; }
[data-theme="light"] .bio-quote { color: #4a3c1a; background: rgba(168,129,44,0.1); }

[data-theme="light"] .stat-label { color: #4a3c1a; opacity: 1; }
[data-theme="light"] .section-title { color: #241c0d; }

/* بطاقات السور */
[data-theme="light"] .sura-card {
  background: linear-gradient(135deg, rgba(168,129,44,0.08), #ffffff);
  border-color: rgba(168,129,44,0.28);
}
[data-theme="light"] .sura-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
[data-theme="light"] .sura-name { color: #241c0d; }
[data-theme="light"] .sura-ayat { color: rgba(36,28,13,0.55); }

/* المكتبة */
[data-theme="light"] .lib-card {
  background: linear-gradient(135deg, rgba(168,129,44,0.07), #ffffff);
  border-color: rgba(168,129,44,0.22);
}
[data-theme="light"] .lib-card:hover { box-shadow: 0 15px 40px rgba(0,0,0,0.12); }
[data-theme="light"] .lib-card-img {
  background: linear-gradient(135deg, #f7f2e7, #efe7d3);
}
[data-theme="light"] .lib-card-img::after {
  background: linear-gradient(to bottom, transparent, rgba(239,231,211,0.85));
}
[data-theme="light"] .lib-card-body h4 { color: #241c0d; }
[data-theme="light"] .lib-card-body p { color: #4a3c1a; }

/* الشريط العلوي والقوائم */
[data-theme="light"] footer { background: #f2ecdd; }
[data-theme="light"] .footer-text,
[data-theme="light"] .footer-copy { color: #4a3c1a; }
[data-theme="light"] .footer-nav a { color: #4a3c1a; }
[data-theme="light"] .footer-copy { border-top-color: rgba(0,0,0,0.06); }

/* مشغل الصوت */
[data-theme="light"] .player-bar {
  background: rgba(255,255,255,0.98);
  border-top-color: rgba(168,129,44,0.35);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

/* صناديق البحث */
[data-theme="light"] .search-box input,
[data-theme="light"] .sidebar-search input {
  background: rgba(168,129,44,0.08);
  border-color: rgba(168,129,44,0.35);
  color: #241c0d;
}
[data-theme="light"] .search-box input::placeholder,
[data-theme="light"] .sidebar-search input::placeholder { color: rgba(36,28,13,0.4); }

/* صفحة القرآن */
[data-theme="light"] .quran-sidebar { background: rgba(255,255,255,0.97); border-left-color: rgba(168,129,44,0.2); }
[data-theme="light"] .sidebar-header { background: rgba(255,255,255,0.99); border-bottom-color: rgba(168,129,44,0.15); }
[data-theme="light"] .sidebar-item { border-bottom-color: rgba(0,0,0,0.05); }
[data-theme="light"] .sidebar-item:hover { background: rgba(168,129,44,0.08); }
[data-theme="light"] .sidebar-item.active { background: rgba(168,129,44,0.14); }
[data-theme="light"] .sidebar-info strong { color: #241c0d; }
[data-theme="light"] .sidebar-info span { color: rgba(36,28,13,0.5); }

[data-theme="light"] .quran-text-area {
  background: #fbf8f0;
  border-color: rgba(168,129,44,0.2);
  color: #1c1608;
}
[data-theme="light"] .verse-inline:hover { background: rgba(168,129,44,0.12); }
[data-theme="light"] .verse-inline.highlighted { background: rgba(168,129,44,0.18); }

[data-theme="light"] .surah-header-card {
  background: linear-gradient(135deg, rgba(168,129,44,0.08), #ffffff);
  border-color: rgba(168,129,44,0.25);
}
[data-theme="light"] .verse-actions { background: rgba(255,255,255,0.99); border-color: rgba(168,129,44,0.3); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }

[data-theme="light"] .tafsir-panel { background: rgba(0,0,0,0.35); }
[data-theme="light"] .tafsir-panel-inner { background: #ffffff; border-color: rgba(168,129,44,0.3); }
[data-theme="light"] .tafsir-header { background: #ffffff; border-bottom-color: rgba(168,129,44,0.15); }
[data-theme="light"] .tafsir-verse-text { color: #241c0d; background: rgba(168,129,44,0.08); }
[data-theme="light"] .tafsir-text-content { color: #3a2f16; }

/* بطل الصفحة الرئيسية (Hero) — خلفية فاتحة */
[data-theme="light"] .hero-bg { filter: brightness(0.95) saturate(0.9); }
[data-theme="light"] .hero-overlay {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(168,129,44,0.10) 0%, transparent 70%),
    linear-gradient(to bottom, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.78) 55%, #ffffff 100%);
}
[data-theme="light"] .hero-title { color: var(--gold); text-shadow: none; }
[data-theme="light"] .hero-sub { color: #241c0d; }
[data-theme="light"] .hero-bismillah { color: var(--gold-light); }
[data-theme="light"] .hero-dates { color: var(--gold-light); }
[data-theme="light"] .hero-verse {
  background: rgba(255,255,255,0.7);
  border-color: rgba(168,129,44,0.35);
  color: #3a2f16;
}
[data-theme="light"] .scroll-indicator { color: var(--gold); }

/* ======================================================================
   القواعد الأساسية
   ====================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--green-deep);
  color: var(--cream);
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--green-deep); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ===== ORNAMENT ===== */
.ornament {
  display: block;
  text-align: center;
  color: var(--gold);
  font-size: 1.4rem;
  letter-spacing: 8px;
  opacity: 0.7;
  margin: 1rem 0;
}

/* ======================================================================
   الشريط العلوي (NAV)
   ====================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: linear-gradient(to bottom, var(--nav-bg-top), var(--nav-bg-bot));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nav-border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  transition: all 0.3s;
}

.site-nav.scrolled {
  height: 60px;
  box-shadow: 0 4px 30px var(--shadow);
}

.nav-logo {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo span { color: var(--cream); font-size: 0.85rem; }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle {
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}
.theme-toggle:hover { background: rgba(201,168,76,0.28); }

.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
}

.nav-links-list {
  display: flex;
  gap: 0.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links-list a {
  color: var(--cream);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
  position: relative;
}

.nav-links-list a::after {
  content: '';
  position: absolute;
  bottom: 0; right: 50%;
  transform: translateX(50%);
  width: 0; height: 2px;
  background: var(--gold);
  transition: width 0.3s;
}

.nav-links-list a:hover { color: var(--gold); }
.nav-links-list a:hover::after { width: 70%; }
.nav-links-list a.active { color: var(--gold); }
.nav-links-list a.active::after { width: 70%; }

@media (max-width: 768px) {
  .nav-toggle-btn { display: block; }
  .nav-links-list {
    display: none;
    position: absolute;
    top: 70px; left: 0; right: 0;
    background: var(--nav-mobile-bg);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--nav-border);
  }
  .nav-links-list.open { display: flex; }
}

/* ======================================================================
   الأقسام والعناوين
   ====================================================================== */
.section-header { text-align: center; margin-bottom: 4rem; }

.section-label {
  font-size: 0.8rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-family: 'Amiri', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--cream);
  line-height: 1.3;
}

.section-title span { color: var(--gold); }

.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--gold));
}

.section-divider::after {
  background: linear-gradient(to right, transparent, var(--gold));
}

.section-divider i { color: var(--gold); font-size: 1rem; }

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 0.8rem 2rem;
  background: var(--gold);
  color: var(--green-deep);
  border: none;
  border-radius: 4px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201,168,76,0.4);
}

[data-theme="light"] .btn-primary { color: #ffffff; }
[data-theme="light"] .btn-primary:hover { color: #ffffff; box-shadow: 0 8px 25px rgba(168,129,44,0.3); }

.btn-outline {
  padding: 0.8rem 2rem;
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  border-radius: 4px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline:hover {
  background: rgba(201,168,76,0.1);
  transform: translateY(-2px);
}

/* ===== STATS BAR ===== */
.stats-bar {
  background: linear-gradient(135deg, var(--green-mid), var(--green-light));
  border-top: 1px solid rgba(201,168,76,0.2);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  padding: 3rem 2rem;
}

.stats-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item { padding: 1rem; }

.stat-num {
  font-family: 'Amiri', serif;
  font-size: 2.5rem;
  color: var(--gold);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* ===== BIO ===== */
.bio-page { background: linear-gradient(to bottom, var(--green-deep), #0a2015); }
[data-theme="light"] .bio-page { background: #ffffff; }

.bio-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
  align-items: start;
}

.bio-img-col { position: sticky; top: 100px; }

.bio-img-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.bio-img-frame::before {
  content: '';
  position: absolute;
  top: -8px; right: -8px;
  bottom: 8px; left: 8px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  z-index: 0;
  opacity: 0.5;
}

.bio-img-frame img {
  width: 100%;
  border-radius: 8px;
  position: relative;
  z-index: 1;
  display: block;
}

.bio-quote {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(201,168,76,0.08);
  border-right: 3px solid var(--gold);
  font-family: 'Amiri', serif;
  font-size: 1rem;
  color: var(--cream-dark);
  line-height: 1.8;
  font-style: italic;
}

.bio-text p {
  color: rgba(245,240,232,0.85);
  line-height: 2;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.bio-text strong { color: var(--gold-light); }

.bio-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.bio-card {
  background: rgba(201,168,76,0.07);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
  transition: all 0.3s;
}

.bio-card:hover {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold);
  transform: translateY(-3px);
}

.bio-card i {
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.bio-card strong {
  display: block;
  font-size: 0.95rem;
  color: var(--cream);
  margin-bottom: 0.3rem;
}

.bio-card span {
  font-size: 0.82rem;
  color: rgba(245,240,232,0.6);
}

/* ===== SURA CARDS ===== */
.suar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.sura-card {
  background: linear-gradient(135deg, rgba(26,74,46,0.5), rgba(13,43,26,0.8));
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.sura-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(to left, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transition: transform 0.4s;
}

.sura-card:hover::before { transform: scaleX(1); }

.sura-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.sura-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sura-num {
  width: 36px; height: 36px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 700;
}

.sura-type {
  font-size: 0.7rem;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  background: rgba(201,168,76,0.1);
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,0.2);
}

.sura-name {
  font-family: 'Scheherazade New', serif;
  font-size: 1.6rem;
  color: var(--cream);
  margin-bottom: 0.3rem;
}

.sura-ayat {
  font-size: 0.8rem;
  color: rgba(245,240,232,0.5);
  margin-bottom: 1.2rem;
}

/* ===== LIBRARY ===== */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.lib-card {
  background: linear-gradient(135deg, rgba(26,74,46,0.4), rgba(13,43,26,0.9));
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}

.lib-card:hover {
  border-color: rgba(201,168,76,0.5);
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.lib-card-img {
  height: 140px;
  background: linear-gradient(135deg, var(--green-mid), var(--green-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.lib-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(13,43,26,0.8));
}

.lib-card-body { padding: 1.2rem; }

.lib-card-body h4 {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.lib-card-body p {
  font-size: 0.82rem;
  color: rgba(245,240,232,0.5);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.lib-tag {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--gold-light);
}

/* ===== AUDIO / DRIVE INFO ===== */
.play-btn {
  width: 38px; height: 38px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-deep);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

[data-theme="light"] .play-btn { color: #ffffff; }

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(201,168,76,0.5);
}

.drive-info {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.drive-info i { font-size: 2rem; color: var(--gold); flex-shrink: 0; }
.drive-info p { font-size: 0.9rem; color: rgba(245,240,232,0.75); line-height: 1.7; }
.drive-info p strong { color: var(--cream); }
.drive-info code {
  background: rgba(0,0,0,0.3);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  direction: ltr;
  display: inline-block;
  margin-top: 0.3rem;
}
[data-theme="light"] .drive-info p { color: #3a2f16; }
[data-theme="light"] .drive-info code { background: rgba(168,129,44,0.12); color: #241c0d; }

.recite-empty {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(201,168,76,0.08);
  border: 1px dashed rgba(201,168,76,0.3);
  border-radius: 8px;
}
.recite-empty strong { display: block; font-size: 0.85rem; color: var(--cream); }
.recite-empty span { font-size: 0.75rem; color: rgba(245,240,232,0.5); }
[data-theme="light"] .recite-empty span { color: rgba(36,28,13,0.5); }

/* ===== PLAYER BAR ===== */
.player-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(13,43,26,0.97);
  border-top: 1px solid rgba(201,168,76,0.3);
  padding: 0.8rem 2rem;
  display: none;
  align-items: center;
  gap: 1.5rem;
  z-index: 999;
  backdrop-filter: blur(10px);
}

.player-bar.visible { display: flex; }

/* ===== QURAN LAYOUT ===== */
.quran-layout {
  display: block;
  min-height: 100vh;
  padding-top: 70px;
  position: relative;
}

/* ===== SIDEBAR ===== */
.quran-sidebar {
  width: 320px;
  background: rgba(10, 30, 18, 0.95);
  border-left: 1px solid rgba(201,168,76,0.2);
  position: fixed;
  top: 70px;
  right: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.3s ease;
  backdrop-filter: blur(10px);
  transform: translateX(0);
}

[dir="rtl"] .quran-sidebar.closed { transform: translateX(330px); }

.sidebar-header {
  padding: 1.2rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  position: sticky;
  top: 0;
  background: rgba(10, 30, 18, 0.98);
  z-index: 2;
}

.sidebar-search input {
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px;
  color: var(--cream);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  outline: none;
}

.sidebar-search input:focus { border-color: var(--gold); }
.sidebar-search input::placeholder { color: rgba(245,240,232,0.35); }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.sidebar-item:hover { background: rgba(201,168,76,0.08); }
.sidebar-item.active { background: rgba(201,168,76,0.15); border-right: 3px solid var(--gold); }

.sidebar-num {
  width: 30px; height: 30px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-info { flex: 1; }
.sidebar-info strong { display: block; font-size: 0.85rem; color: var(--cream); }
.sidebar-info span { font-size: 0.7rem; color: rgba(245,240,232,0.45); }

.sidebar-toggle {
  position: fixed;
  top: 85px;
  right: 0;
  z-index: 51;
  background: var(--gold);
  color: var(--green-deep);
  border: none;
  border-radius: 8px 0 0 8px;
  padding: 0.8rem 0.7rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  box-shadow: -3px 3px 10px rgba(0,0,0,0.3);
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
[data-theme="light"] .sidebar-toggle { color: #ffffff; }

.sidebar-toggle:hover { background: var(--gold-light); transform: translateX(-3px); }

/* ===== QURAN MAIN ===== */
.quran-main {
  flex: 1;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  transition: margin 0.3s;
}

.quran-text-area {
  font-family: 'Scheherazade New', serif;
  font-size: 1.8rem;
  line-height: 3;
  color: var(--cream);
  text-align: justify;
  direction: rtl;
  padding: 1.5rem;
  background: rgba(0,0,0,0.15);
  border-radius: 12px;
  border: 1px solid rgba(201,168,76,0.1);
}

.quran-word {
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  border-radius: 4px;
  padding: 0 2px;
}

.quran-word:hover { color: var(--gold); }

.verse-inline {
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
  padding: 2px 4px;
}

.verse-inline:hover { background: rgba(201,168,76,0.1); }

.verse-inline.highlighted {
  background: rgba(201,168,76,0.2);
  border-bottom: 2px solid var(--gold);
}

.verse-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50%;
  font-size: 0.65rem;
  color: var(--gold);
  font-family: 'Cairo', sans-serif;
  margin: 0 4px;
  vertical-align: middle;
}

/* ===== SURAH HEADER ===== */
.surah-header-card {
  text-align: center;
  padding: 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(26,74,46,0.4), rgba(13,43,26,0.8));
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 16px;
}

.surah-header-card h1 {
  font-family: 'Scheherazade New', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* ===== TOOLBAR ===== */
.quran-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.toolbar-btn {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.toolbar-btn:hover { background: rgba(201,168,76,0.2); border-color: var(--gold); }
.toolbar-btn.active { background: var(--gold); color: var(--green-deep); }

.toolbar-separator {
  width: 1px;
  height: 24px;
  background: rgba(201,168,76,0.2);
  margin: 0 0.3rem;
}

/* ===== VERSE ACTIONS POPUP ===== */
.verse-actions {
  position: absolute;
  top: -45px;
  right: 50%;
  transform: translateX(50%);
  background: rgba(13,43,26,0.97);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  padding: 0.4rem;
  display: flex;
  gap: 0.3rem;
  z-index: 30;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.verse-action-btn {
  background: none;
  border: none;
  color: var(--gold);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.verse-action-btn:hover { background: rgba(201,168,76,0.15); }

/* ===== TAFSIR PANEL (OVERLAY) ===== */
.tafsir-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(3px);
}

.tafsir-panel.open { opacity: 1; pointer-events: all; }

.tafsir-panel-inner {
  background: rgba(10, 30, 18, 0.98);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
}

.tafsir-header {
  padding: 1.2rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(10, 30, 18, 0.98);
  z-index: 2;
}

.tafsir-header h3 {
  font-family: 'Amiri', serif;
  color: var(--gold);
  font-size: 1.1rem;
}

.tafsir-body { padding: 1.5rem; }

.tafsir-verse-text {
  font-family: 'Scheherazade New', serif;
  font-size: 1.3rem;
  color: var(--cream);
  line-height: 2;
  padding: 1rem;
  background: rgba(201,168,76,0.08);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.tafsir-edition-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tafsir-tab {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  border: 1px solid rgba(201,168,76,0.3);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: all 0.2s;
}

.tafsir-tab:hover { background: rgba(201,168,76,0.1); }
.tafsir-tab.active { background: var(--gold); color: var(--green-deep); }
[data-theme="light"] .tafsir-tab.active { color: #ffffff; }

.tafsir-text-content {
  font-size: 1rem;
  color: rgba(245,240,232,0.85);
  line-height: 2;
}

.tafsir-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(201,168,76,0.15);
}

.tafsir-nav button {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tafsir-nav button:hover { background: rgba(201,168,76,0.2); }
.tafsir-nav button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== FONT SIZE CONTROL ===== */
.font-size-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.font-size-control button {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== SEARCH BOX ===== */
.search-box {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 2rem;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.8rem 1.2rem 0.8rem 3rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  color: var(--cream);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.search-box input:focus { border-color: var(--gold); }
.search-box input::placeholder { color: rgba(245,240,232,0.4); }

.search-box i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* فقرات المقدمة والملاحظات — تتكيف مع الوضعين */
.home-intro { color: rgba(245,240,232,0.85); }
[data-theme="light"] .home-intro { color: #3a2f16; }
.muted-note { color: rgba(245,240,232,0.4); font-size: 0.85rem; }
[data-theme="light"] .muted-note { color: rgba(36,28,13,0.55); }

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== HERO ===== */
.hero-section {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://elsakhy.com/wp-content/uploads/2026/04/header-bg2.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.35) saturate(0.8);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.12) 0%, transparent 70%),
    linear-gradient(to bottom, rgba(13,43,26,0.3) 0%, rgba(13,43,26,0.7) 60%, var(--green-deep) 100%);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 900px;
}

.hero-bismillah {
  font-family: 'Scheherazade New', serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--gold-light);
  margin-bottom: 2rem;
  animation: fadeDown 1s ease forwards;
}

.hero-img-wrap {
  width: 180px;
  height: 180px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(201,168,76,0.2), 0 0 40px rgba(201,168,76,0.3);
  overflow: hidden;
  animation: fadeIn 1.2s ease 0.3s forwards;
  opacity: 0;
}

.hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-title {
  font-family: 'Amiri', serif;
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--gold);
  line-height: 1.3;
  animation: fadeUp 1s ease 0.5s forwards;
  opacity: 0;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-sub {
  font-family: 'Amiri', serif;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--cream);
  margin: 1rem 0 0.5rem;
  animation: fadeUp 1s ease 0.7s forwards;
  opacity: 0;
}

.hero-dates {
  font-size: 0.9rem;
  color: var(--gold-light);
  opacity: 0;
  animation: fadeUp 1s ease 0.9s forwards;
}

.hero-verse {
  margin: 2rem auto;
  max-width: 600px;
  padding: 1.5rem;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  font-family: 'Scheherazade New', serif;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--cream-dark);
  line-height: 2;
  animation: fadeUp 1s ease 1.1s forwards;
  opacity: 0;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
  animation: fadeUp 1s ease 1.3s forwards;
  opacity: 0;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  color: var(--gold);
  opacity: 0.6;
  font-size: 1.5rem;
  z-index: 2;
}

/* ===== FOOTER ===== */
footer.site-footer {
  background: #060f09;
  border-top: 1px solid rgba(201,168,76,0.2);
  padding: 3rem 2rem 1.5rem;
  text-align: center;
}

.footer-logo {
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-text {
  font-size: 0.85rem;
  color: rgba(245,240,232,0.5);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.footer-nav a {
  color: rgba(245,240,232,0.6);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-nav a:hover { color: var(--gold); }

.footer-copy {
  font-size: 0.75rem;
  color: rgba(245,240,232,0.3);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

[data-theme="light"] footer.site-footer { background: #f2ecdd; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .quran-sidebar { width: 280px; }
  .tafsir-panel { width: 100%; }
  .quran-text-area { font-size: 1.4rem; line-height: 2.5; padding: 1rem; }
  .quran-toolbar { gap: 0.3rem; }
  .bio-grid { grid-template-columns: 1fr; }
  .bio-img-col { position: static; }
  .bio-info-cards { grid-template-columns: 1fr 1fr; }
  .hero-content { padding: 5rem 1.5rem 3rem; }
  .suar-grid { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: 1fr; }
  .player-bar { flex-direction: column; gap: 0.5rem; padding: 0.5rem 1rem; }
}
