/* DashCast — واجهة العرض العامة. داكنة لأن المحتوى فيديو: الإطار الفاتح حول
   مقطعٍ ساطع يُتعب العين، والداكن يُبقي الانتباه على المشغّل. */

:root {
  --bg: #0b1220;
  --bg-2: #111c31;
  --card: #16243c;
  --line: #22334f;
  --ink: #eef4ff;
  --muted: #8fa3c4;
  --brand: #38bdf8;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 460px at 85% -8%, rgba(56, 189, 248, .16), transparent 62%),
    radial-gradient(760px 420px at 8% 0%, rgba(139, 92, 246, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15.5px/1.85 system-ui, "Segoe UI", Tahoma, sans-serif;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 22px; }

/* ── الترويسة ───────────────────────────────────────────── */
.nav { border-bottom: 1px solid var(--line); background: rgba(11, 18, 32, .82);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 30; }
.nav .wrap { display: flex; align-items: center; gap: 14px; height: 68px; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; }
.logo .mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #22d3ee); color: #fff; overflow: hidden; }
.logo .mark svg { width: 100%; height: 100%; }   /* شعار DashCast — انظر favicon.svg */
.nav .sp { margin-inline-start: auto; }
.nav a.q { color: var(--muted); font-size: 14px; font-weight: 700; }
.nav a.q:hover { color: var(--ink); }

/* قائمة اللغات — كرةٌ أرضية ثم الاسم بلغته (`partials.lang-select`). */
.langs { position: relative; display: inline-flex; align-items: center; color: var(--muted); flex-shrink: 0; }
.langs svg { position: absolute; inset-inline-start: 10px; width: 16px; height: 16px; pointer-events: none; }
.langs select { appearance: none; min-height: 36px; padding-block: 0; padding-inline: 32px 12px;
  font: inherit; font-size: 13px; font-weight: 700; max-width: 150px; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); }
.langs select:hover { border-color: rgba(255, 255, 255, .22); }
.langs option { background: #0e1626; color: var(--ink); }

/* الأسهم مكتوبةٌ للعربية (← إلى الأمام)؛ تُقلب في اللغات اليسارية. */
.arr { font-style: normal; display: inline-block; }
[dir="ltr"] .arr { transform: scaleX(-1); }

/* ── الواجهة ────────────────────────────────────────────── */
.hero { padding: 66px 0 40px; }
.hero h1 { font-size: clamp(28px, 4.6vw, 46px); line-height: 1.25; margin: 0 0 14px; font-weight: 800;
  letter-spacing: -.5px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0; }
.grad { background: linear-gradient(120deg, #38bdf8, #a78bfa 60%, #f0abfc);
  -webkit-background-clip: text; background-clip: text; color: transparent; }

.crumb { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.crumb a:hover { color: var(--brand); }

/* ── الشبكة والبطاقات ───────────────────────────────────── */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.sys {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.sys:hover { transform: translateY(-3px); border-color: #35507a;
  box-shadow: 0 20px 42px -22px rgba(0, 0, 0, .85); }
.sys .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; }
.sys h3 { margin: 0; font-size: 19px; font-weight: 800; }
.sys p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.sys .meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; gap: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }

.c-sky     { background: rgba(56,189,248,.16); color: #7dd3fc; }
.c-violet  { background: rgba(167,139,250,.16); color: #c4b5fd; }
.c-emerald { background: rgba(52,211,153,.16); color: #6ee7b7; }
.c-amber   { background: rgba(251,191,36,.16); color: #fcd34d; }
.c-rose    { background: rgba(251,113,133,.16); color: #fda4af; }
.c-slate   { background: rgba(148,163,184,.16); color: #cbd5e1; }

/* ── بطاقة الدرس ────────────────────────────────────────── */
.lesson { display: flex; gap: 18px; padding: 16px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--card); align-items: center;
  transition: border-color .18s, background .18s; }
.lesson:hover { border-color: #35507a; background: #1a2a45; }
.lesson .thumb { width: 190px; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover;
  background: #0b1220; flex-shrink: 0; }
.lesson .no { width: 32px; height: 32px; border-radius: 9px; background: rgba(56,189,248,.14);
  color: #7dd3fc; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  flex-shrink: 0; }
.lesson h3 { margin: 0 0 5px; font-size: 16.5px; font-weight: 800; }
.lesson p { margin: 0; color: var(--muted); font-size: 13.5px; }
.lesson .dur { margin-inline-start: auto; color: var(--muted); font-size: 13px;
  font-weight: 700; flex-shrink: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ── المشغّل ────────────────────────────────────────────── */
.player { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: #000; box-shadow: 0 30px 70px -30px rgba(56, 189, 248, .35), 0 24px 50px -24px rgba(0, 0, 0, .9); }
.player video { width: 100%; display: block; aspect-ratio: 16/9; }

.split { display: grid; grid-template-columns: 1fr 330px; gap: 26px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.split .panel { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
.panel h4 { margin: 0 0 14px; font-size: 14px; font-weight: 800; color: var(--ink);
  letter-spacing: .3px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel h4 span { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.side-item { display: flex; gap: 11px; padding: 10px; border-radius: 10px; align-items: center; }
.side-item:hover { background: #1a2a45; }
.side-item.on { background: rgba(56,189,248,.13); }
.side-item .n { width: 26px; height: 26px; border-radius: 8px; background: #0b1220; color: var(--muted);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800; flex-shrink: 0; }
.side-item.on .n { background: var(--brand); color: #06121f; }
.side-item span.t { font-size: 13.5px; font-weight: 700; line-height: 1.5; min-width: 0; }
.side-item span.t small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }
.side-item .th { width: 92px; aspect-ratio: 16/9; border-radius: 7px; object-fit: cover; flex-shrink: 0;
  border: 2px solid transparent; }
.side-item.on .th { border-color: var(--brand); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.btn:hover { background: #1a2a45; }
.btn.primary { background: linear-gradient(135deg, #38bdf8, #6366f1); border: 0; color: #06121f; }
.btn.primary:hover { filter: brightness(1.08); }

.share { position: relative; }
.share > summary { list-style: none; user-select: none; }
.share > summary::-webkit-details-marker { display: none; }
.share[open] > summary { background: #1a2a45; border-color: var(--brand); }
.share-menu { position: absolute; z-index: 20; inset-inline-start: 0; top: calc(100% + 8px);
  width: min(340px, calc(100vw - 32px)); padding: 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg-2); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.share-copy { display: flex; gap: 8px; }
.share-copy input { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--muted); font: inherit; font-size: 13px; }
.share-copy .btn { padding: 9px 14px; font-size: 13px; white-space: nowrap; }
.share-nets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.share-nets a { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 700; }
.share-nets a:hover { border-color: var(--brand); color: var(--brand); }

/* ── معرض الدروس (صفحة الدورة) — الملصق يقود البطاقة ─────── */
.vgrid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.vcard { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--bg-2)); overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.vcard:hover { transform: translateY(-3px); border-color: #35507a;
  box-shadow: 0 22px 44px -22px rgba(0, 0, 0, .9); }
.vcard .cover { position: relative; display: block; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1b2b48, #0b1220); }
.vcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease; }
.vcard:hover .cover img { transform: scale(1.04); }
.vcard .play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%;
  background: rgba(6, 18, 31, .62); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(6px);
  opacity: .9; transition: background .18s, transform .18s; }
.vcard .play::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0;
  transform: translateX(2px); border-style: solid; border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff; }
.vcard:hover .play { background: var(--brand); transform: scale(1.08); }
.vcard:hover .play::after { border-left-color: #06121f; }
.vcard .no, .vcard .dur { position: absolute; top: 10px; padding: 2px 9px; border-radius: 8px;
  background: rgba(6, 18, 31, .78); font-size: 12.5px; font-weight: 800; line-height: 1.7; }
.vcard .no { inset-inline-start: 10px; color: #7dd3fc; }
.vcard .dur { top: auto; bottom: 10px; inset-inline-end: 10px; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.vcard .body { padding: 16px 18px 20px; }
.vcard h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 800; line-height: 1.5; }
.vcard p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* غلاف بطاقة الدورة (صفحة النظام). */
.sys img.cover { margin: -24px -24px 4px; width: calc(100% + 48px); max-width: none; aspect-ratio: 16/9;
  object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }

/* دعوة «صُنع بـ DashCast» — صفحات المالك وحدها (`partials.showcase-cta`). */
.cta { margin-top: 44px; padding: 24px 26px; border-radius: var(--radius); display: flex; align-items: center;
  gap: 20px; flex-wrap: wrap; border: 1px solid rgba(56, 189, 248, .3);
  background: linear-gradient(120deg, rgba(56, 189, 248, .12), rgba(139, 92, 246, .12)); }
.cta > div { flex: 1; min-width: 240px; }
.cta strong { font-size: 18px; font-weight: 800; }
.cta p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.foot { margin-top: 70px; padding: 26px 0; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split .panel { position: static; max-height: none; }
  .lesson .thumb { width: 128px; }
}
@media (max-width: 560px) {
  .lesson { flex-wrap: wrap; }
  .lesson .thumb { width: 100%; }
  .logo { font-size: 15px; min-width: 0; }
  .langs select { max-width: 120px; }
}

/* النصّ المنطوق خطوةً بخطوة تحت الفيديو (showcase/video) */
.transcript { margin: 30px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.transcript h2 { margin: 0 0 14px; font-size: 19px; font-weight: 800; color: var(--ink); }
.transcript ol { margin: 0; padding-inline-start: 24px; display: grid; gap: 12px; }
.transcript li { color: #c9d6ec; line-height: 1.75; padding-inline-start: 4px; }
.transcript li::marker { color: var(--brand); font-weight: 800; }
.made-with { margin: 16px 0 0; color: var(--muted); font-size: 13.5px; }
.made-with a { color: var(--brand); font-weight: 700; }
.made-with a:hover { text-decoration: underline; }
