@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --green-900: #0c3527;
  --green-800: #124430;
  --green-700: #155238;
  --green-600: #1e6646;
  --gold: #d1b15a;
  --gold-soft: #e6d19a;
  --cream: #f4f0e9;
  --paper: #f7f5f0;
  --ink: #10281f;
  --muted: #698277;
  --white: #fff;
  --border: rgba(209, 177, 90, 0.35);
  --shadow: 0 18px 40px rgba(9, 28, 21, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
iframe { width: 100%; height: 100%; border: 0; }
.container { width: min(1280px, 92%); margin: 0 auto; }
.min-screen { min-height: 70vh; }

.pattern-bg {
  background-image:
    radial-gradient(circle at 15% 20%, rgba(209,177,90,.07), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(209,177,90,.08), transparent 20%),
    linear-gradient(rgba(255,255,255,.03), rgba(255,255,255,.03)),
    linear-gradient(45deg, rgba(209,177,90,.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(209,177,90,.045) 25%, transparent 25%);
  background-size: auto, auto, auto, 60px 60px, 60px 60px;
  background-position: center, center, center, 0 0, 0 0;
}

.topbar {
  background: linear-gradient(90deg, #103c2c, #0b3325);
  border-bottom: 2px solid rgba(209, 177, 90, .55);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner {
  display: grid;
  grid-template-columns: 280px 1fr 150px;
  align-items: center;
  gap: 20px;
  min-height: 82px;
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--gold-soft); }
.brand-logo {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  border: 1px solid rgba(209,177,90,.45);
  background: rgba(209,177,90,.08);
  overflow: hidden;
}
.brand-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.brand strong { display: block; font-size: 28px; line-height: 1; }
.brand span { display: block; font-size: 13px; color: #b7c7bf; margin-top: 5px; white-space: nowrap; }
.main-nav { display: flex; justify-content: center; gap: 28px; }
.main-nav a { color: #edf4ef; font-weight: 700; font-size: 16px; opacity: .82; }
.main-nav a.active, .main-nav a:hover { color: var(--white); opacity: 1; }
.live-pill {
  justify-self: end;
  color: #f6b0b0;
  border: 1px solid rgba(255, 98, 98, 0.22);
  background: rgba(255, 98, 98, 0.08);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
}

.hero-section {
  background: linear-gradient(180deg, #0f412f 0%, #0c3527 100%);
  color: var(--white);
  padding: 56px 0 34px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 420px;
  gap: 36px;
  align-items: center;
}
.eyebrow { color: var(--gold-soft); font-weight: 700; }
.hero-content h1 {
  font-family: "Amiri", "Cairo", Tahoma, Arial, sans-serif;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  margin: 16px 0;
}
.hero-text {
  font-size: 21px;
  color: #e0ece4;
  max-width: 760px;
}
.tags-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }
.tags-row span, .chip, .counter-pill {
  border: 1px solid var(--border);
  color: var(--gold-soft);
  background: rgba(209,177,90,.09);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 18px; padding: 16px 28px; font-weight: 800;
  border: 1px solid transparent; transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: #173020; box-shadow: 0 16px 30px rgba(209,177,90,.16); }
.btn-outline { border-color: rgba(209,177,90,.35); color: var(--gold-soft); background: transparent; }
.btn-green { background: #145234; color: #fff; }
.btn-red-outline { border-color: rgba(235,120,120,.35); color: #ce3c3c; background: #fff7f7; }
.full-width { width: 100%; }
.hero-image-wrap { display: flex; justify-content: center; }
.hero-image {
  width: 330px; height: 330px; object-fit: cover;
  border-radius: 50%; border: 6px solid rgba(209,177,90,.75);
  box-shadow: 0 0 0 24px rgba(209,177,90,.07), 0 0 0 44px rgba(209,177,90,.03);
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(209,177,90,.26);
}
.stat-box { text-align: center; color: #dfeae1; }
.stat-box strong { display: block; font-size: 42px; color: var(--gold); }
.stat-box span { display: block; margin-top: 6px; color: #cbd9d0; }

.section { padding: 54px 0; }
.light-surface { background: var(--paper); }
.dark-surface { background: linear-gradient(180deg, #0e442f, #0b3325); color: var(--white); }
.dark-surface-rounded { border-radius: 32px; padding: 24px; }
.section-head, .page-head {
  display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px;
}
.section-head h2, .page-head h1 { margin: 8px 0 0; font-size: 38px; color: #10392a; }
.dark-head h1, .dark-head p, .dark-surface .section-head h2 { color: var(--white); }
.section-kicker, .more-link { color: var(--gold); font-weight: 800; }
.page-head p, .section-head p { color: var(--muted); }

.live-layout {
  display: grid; grid-template-columns: minmax(0, 2fr) 360px; gap: 28px; align-items: start;
}
.video-card {
  background: #1d1d1d; border-radius: 28px; overflow: hidden; border: 2px solid rgba(209,177,90,.72); box-shadow: var(--shadow);
}
.big-video { aspect-ratio: 16 / 9; }
.big-video iframe, .detail-video iframe { min-height: 620px; }
.big-video iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.video-poster {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  padding: 0;
  background: #111;
  cursor: pointer;
  display: block;
}
.video-poster img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}
.video-poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.14), rgba(0,0,0,.42));
}
.video-topic {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: #fff;
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  background: rgba(10, 30, 22, .62);
  border: 1px solid rgba(209, 177, 90, .6);
  border-radius: 14px;
  padding: 10px 18px;
  width: min(88%, 760px);
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.video-play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(196, 34, 34, .92);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(0,0,0,.3);
  transition: transform .2s ease, background .2s ease;
}
.video-play-btn svg {
  width: 34px;
  height: 34px;
  margin-right: -5px;
}
.video-poster:hover .video-play-btn {
  transform: scale(1.07);
  background: rgba(220, 30, 30, .95);
}
.placeholder {
  min-height: 0; height: 100%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #0d3728, #0f4430);
}
.card-light {
  background: #fff; border: 1px solid rgba(209,177,90,.35); border-radius: 28px; box-shadow: var(--shadow); padding: 26px;
}
.live-sidebar h2 { font-size: 42px; margin: 18px 0 10px; color: #10392a; }
.live-sidebar p { color: var(--muted); line-height: 1.9; }
.status-dot { color: #e65353; font-weight: 800; }
.viewers-box {
  background: #f0f5f1; border: 1px solid #d8e7de; padding: 18px 20px; border-radius: 18px; margin: 24px 0; color: #315f49; font-weight: 700;
}
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-profile {
  margin-top: 22px; display: flex; align-items: center; gap: 14px;
  border-radius: 22px; padding: 16px; color: #f5e2a2;
  background: linear-gradient(135deg, #10442f, #0d3728);
}
.mini-profile img { width: 76px; height: 76px; object-fit: cover; border-radius: 22px; border: 2px solid rgba(209,177,90,.5); }
.mini-profile span { display: block; color: #b9d0c4; margin-top: 4px; }

.category-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.category-tabs span {
  padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); color: #dbe6df;
}
.category-tabs .active { background: var(--gold); color: #183122; }
.cards-grid { display: grid; gap: 18px; }
.lessons-grid { grid-template-columns: repeat(4, 1fr); }
.lesson-card {
  border: 1px solid rgba(209,177,90,.28); border-radius: 22px; overflow: hidden; background: rgba(255,255,255,.06); backdrop-filter: blur(4px);
}
.lesson-thumb {
  height: 180px; display: grid; place-items: center; position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(209,177,90,.08));
}
.play-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(209,177,90,.6); color: var(--gold);
}
.duration-badge {
  position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.8); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px;
}
.lesson-body { padding: 16px; }
.lesson-body h3 { margin: 14px 0 10px; font-size: 20px; line-height: 1.6; }
.lesson-body h3 a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.2em;
}
.lesson-body a { color: inherit; }
.meta-row { color: #c5d2cb; font-size: 14px; }
.dark-surface .meta-row { color: #c5d2cb; }

.quran-banner {
  background: linear-gradient(90deg, #0d4a33, #14513b); color: #f2d589;
  border-radius: 20px; padding: 26px 24px; text-align: center; font-weight: 800; margin-bottom: 24px;
}
.hizb-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px;
}
.hizb-box {
  min-height: 88px; border-radius: 12px; display: grid; place-items: center; text-align: center; padding: 8px;
  border: 1px solid #dce4df; background: #eef2ef; color: #aab6b1;
}
.hizb-box.enabled { background: linear-gradient(180deg, #0f4e36, #0c3d2a); color: var(--gold); box-shadow: 0 8px 20px rgba(12,61,42,.12); }
.hizb-box strong { display: block; font-size: 22px; }
.hizb-box span { font-size: 12px; }

.split-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; }
.duas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dua-card {
  background: #fff; border: 1px solid rgba(209,177,90,.35); border-radius: 16px; padding: 16px; box-shadow: var(--shadow);
}
.dua-card.expanded p { min-height: auto; }
.dua-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.icon-square {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #13462f; color: #f0d58a;
}
.dua-top small { display: block; color: #8ba095; margin-top: 4px; }
.dua-card p { color: #556d61; line-height: 1.8; }
.small-link { color: #aa8a2d; font-weight: 700; font-size: 14px; }

.books-section { color: #fff; }
.books-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.book-card, .book-page-card {
  min-height: 196px; border-radius: 14px; color: #fff; box-shadow: var(--shadow); overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
}
.book-inner {
  height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 18px;
}
.book-inner span { font-size: 14px; opacity: .85; }
.book-inner strong, .book-inner h3 { margin: 10px 0 8px; font-size: 24px; }
.book-inner small { opacity: .9; }
.book-inner p { margin-top: 12px; line-height: 1.8; color: rgba(255,255,255,.88); }
.books-grid-page { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.color-1 { background: linear-gradient(160deg, #226f65, #2e9577); }
.color-2 { background: linear-gradient(160deg, #b28726, #d4aa40); }
.color-3 { background: linear-gradient(160deg, #1f7f8e, #25a8b7); }
.color-4 { background: linear-gradient(160deg, #184f3f, #1c6d58); }
.color-5 { background: linear-gradient(160deg, #b56206, #db7b0b); }
.color-6 { background: linear-gradient(160deg, #0a866b, #0ca585); }

.schedule-grid { grid-template-columns: repeat(4, 1fr); }
.schedule-card h3 { margin: 16px 0 8px; color: #10392a; }
.schedule-card p { color: #698277; line-height: 1.8; }
.prayer-box h2 { color: #10392a; margin-top: 0; }
.prayer-row {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px dashed rgba(16,57,42,.12);
}

.detail-card { max-width: 980px; margin: 0 auto; }
.detail-card h1 { color: #10392a; }
.detail-video { margin: 24px 0; min-height: 480px; }
.detail-video iframe { min-height: 480px; }

.site-footer {
  background: linear-gradient(180deg, #0d412d, #0a3224); color: #e2eee7; padding-top: 36px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.site-footer h3, .site-footer h4 { color: var(--gold-soft); margin-top: 0; }
.site-footer p, .site-footer li { color: #c2d3c8; line-height: 1.9; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 24px; padding: 16px 0; color: #aabeb4; text-align: center; }

@media (max-width: 1200px) {
  .lessons-grid, .schedule-grid { grid-template-columns: repeat(3, 1fr); }
  .hizb-grid { grid-template-columns: repeat(10, 1fr); }
}
@media (max-width: 1024px) {
  .topbar-inner, .hero-grid, .live-layout, .split-grid, .footer-grid { grid-template-columns: 1fr; }
  .main-nav { flex-wrap: wrap; gap: 16px; }
  .hero-image { width: 280px; height: 280px; }
  .video-topic { bottom: 16px; font-size: clamp(16px, 3.6vw, 24px); }
  .books-row, .books-grid-page, .duas-grid { grid-template-columns: repeat(2, 1fr); }
  .hizb-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 768px) {
  .stats-grid, .lessons-grid, .schedule-grid, .duas-grid, .books-row, .books-grid-page { grid-template-columns: 1fr; }
  .button-row { grid-template-columns: 1fr; }
  .hizb-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-content h1, .section-head h2, .page-head h1, .live-sidebar h2 { font-size: 30px; }
  .hero-text { font-size: 17px; }
}

.quran-detail-surface {
  background:
    radial-gradient(circle at 12% 10%, rgba(209,177,90,.12), transparent 18%),
    radial-gradient(circle at 88% 8%, rgba(20,81,59,.09), transparent 20%),
    var(--paper);
}
.quran-page-shell {
  width: min(1080px, 94%);
  margin: 0 auto;
}
.maghribi-page-card {
  background: #fff;
  border: 1px solid rgba(209,177,90,.45);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.maghribi-head {
  text-align: center;
  margin-bottom: 18px;
}
.maghribi-chip {
  display: inline-block;
  border: 1px solid var(--border);
  background: rgba(209,177,90,.12);
  color: #9c7a22;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
}
.maghribi-title {
  margin: 12px 0 8px;
  font-family: "Amiri", "Cairo", Tahoma, serif;
  font-size: clamp(28px, 4vw, 44px);
  color: #0d4a33;
}
.maghribi-subtitle {
  margin: 0;
  font-family: "Amiri", "Cairo", Tahoma, serif;
  font-size: clamp(18px, 2.2vw, 26px);
  color: #1b6047;
}
.maghribi-ornament-frame {
  border: 10px solid transparent;
  border-image: linear-gradient(180deg, #b9d3c9, #73a792, #b9d3c9) 1;
  border-radius: 18px;
  background: #fbfcfb;
  padding: 14px;
}
.maghribi-image-wrap {
  background: linear-gradient(180deg, #f8faf9, #eef5f1);
  border: 1px solid rgba(94, 151, 127, .42);
  border-radius: 14px;
  padding: 12px;
}
.maghribi-page-image {
  width: 100%;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto;
}
.maghribi-text-fallback {
  text-align: center;
  font-family: "Amiri", "Cairo", Tahoma, serif;
  font-size: 34px;
  line-height: 2;
  color: #174f3a;
  padding: 36px 24px;
}

@media (max-width: 768px) {
  .maghribi-page-card { padding: 14px; }
  .maghribi-ornament-frame { padding: 8px; }
  .maghribi-image-wrap { padding: 8px; }
  .maghribi-text-fallback { font-size: 28px; }
}
