@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');
:root{--bg:#07101f;--panel:#101c2e;--panel2:#14233a;--text:#f8fafc;--muted:#91a0b5;--accent:#d8ad58;--accent2:#f3d98e;--line:#ffffff16;--soft:#ffffff09;--good:#32d18a;--danger:#f05252;--shadow:#0007}body[data-theme=light]{--bg:#f3f6fb;--panel:#fff;--panel2:#edf2f8;--text:#152033;--muted:#64748b;--accent:#a87522;--accent2:#c28c32;--line:#14213d16;--soft:#14213d08;--shadow:#64748b2b}body[data-theme=pink]{--bg:#fff3f8;--panel:#fffafd;--panel2:#f9ddea;--text:#432438;--muted:#8b647b;--accent:#d34d8a;--accent2:#f07caf;--line:#8e31551c;--soft:#d34d8a0d;--shadow:#8e31552b}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:Cairo,system-ui,sans-serif;transition:.3s;min-height:100vh}button,a,input,select{font:inherit}.sprite{position:absolute;width:0;height:0;overflow:hidden}.bar{height:72px;max-width:1100px;margin:auto;padding:0 20px;display:flex;align-items:center;gap:14px;border-bottom:1px solid var(--line);position:sticky;top:0;background:color-mix(in srgb,var(--bg) 90%,transparent);backdrop-filter:blur(14px);z-index:20}.brand{margin-left:auto}.brand b{display:block;font-size:13px;letter-spacing:1px;color:var(--accent)}.brand small{color:var(--muted)}.tools{display:flex;gap:8px}.icon{width:44px;height:44px;border:1px solid var(--line);background:var(--soft);color:var(--text);border-radius:13px;display:grid;place-items:center}.icon svg,.primary svg,.danger svg,.actions svg,.watched svg,.addBtn svg,.close svg,.adminActions svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.hidden{visibility:hidden}.screen{display:none;max-width:1000px;margin:auto;padding:35px 20px 60px;animation:in .4s ease}.screen.active{display:block}@keyframes in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}.hero{min-height:620px;grid-template-columns:1fr 1fr;align-items:center;gap:35px}.hero.active{display:grid}.teacher{height:540px;display:flex;justify-content:center;align-items:flex-end;position:relative}.teacher img{max-width:100%;max-height:535px;position:relative;z-index:2;filter:drop-shadow(0 25px 30px #0005)}.halo{position:absolute;width:360px;height:360px;bottom:60px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--accent) 25%,transparent),transparent 68%)}.badge{display:inline-block;padding:6px 13px;border:1px solid color-mix(in srgb,var(--accent) 35%,transparent);border-radius:99px;color:var(--accent);font-weight:800;font-size:12px}.eyebrow{color:var(--accent);font-weight:800}.hero h1{font-size:clamp(40px,6vw,70px);line-height:1.12;margin:8px 0}.hero h1 em{font-style:normal;color:var(--accent2)}.hero h2{font-size:20px;margin:20px 0 4px}.heroText>p:last-of-type{color:var(--muted)}.primary,.danger,.addBtn{width:min(100%,420px);min-height:54px;padding:13px 18px;border-radius:15px;font-weight:900;margin-top:10px;display:inline-flex;align-items:center;justify-content:center;gap:9px}.primary{border:0;background:linear-gradient(135deg,var(--accent2),var(--accent));color:#18120a;box-shadow:0 10px 28px color-mix(in srgb,var(--accent) 18%,transparent)}.danger{background:#ef444414;color:#ef5555;border:1px solid #ef44443b}.danger{animation:dangerPulse 2.5s infinite}@keyframes dangerPulse{50%{box-shadow:0 0 0 6px #ef444408}}.holdHint{font-size:9px;color:var(--muted);margin-top:8px;opacity:.45}.title span{color:var(--accent);font-size:12px}.title h2{margin:4px 0 24px;font-size:27px}.cards,.lessonList,.adminList{display:flex;flex-direction:column;gap:12px}.chapter,.topic{width:100%;min-height:82px;padding:16px;border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:18px;display:grid;grid-template-columns:52px 1fr auto;align-items:center;gap:14px;text-align:right;box-shadow:0 8px 24px var(--shadow)}.chapter b,.topic>b{width:45px;height:45px;display:grid;place-items:center;border-radius:13px;background:var(--soft);color:var(--accent)}.chapter h3,.topic h3{margin:0;font-size:15px}.chapter p,.topic p{margin:3px 0 0;color:var(--muted);font-size:11px}.stateIcon{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;color:var(--muted);background:var(--soft)}.stateIcon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.locked{opacity:.58}.available{color:var(--good);font-size:11px}.skeleton{height:82px;border-radius:18px;background:linear-gradient(90deg,var(--panel),var(--panel2),var(--panel));background-size:200% 100%;animation:shimmer 1.3s infinite}@keyframes shimmer{to{background-position:-200% 0}}.progressBox{display:grid;grid-template-columns:1fr auto;gap:12px;background:var(--panel);border:1px solid var(--line);padding:18px;border-radius:18px;margin-bottom:18px}.progressBox span,.progressBox b{display:block}.progressBox span{font-size:11px;color:var(--muted)}.progressBox strong{font-size:22px;color:var(--accent)}.track{grid-column:1/-1;height:8px;background:var(--soft);border-radius:9px;overflow:hidden}.track i{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:.5s}.lesson{display:grid;grid-template-columns:150px 1fr 54px;min-height:105px;background:var(--panel);border:1px solid var(--line);border-radius:17px;overflow:hidden}.lesson img{width:150px;height:100%;object-fit:cover}.lesson .info{padding:14px;align-self:center;cursor:pointer}.lesson small{color:var(--accent)}.lesson h3{font-size:13px;margin:4px 0}.eye{border:0;border-right:1px solid var(--line);background:transparent;color:var(--muted);display:grid;place-items:center}.eye svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}.lesson.done{border-color:#32d18a55}.lesson.done .eye{color:var(--good)}.empty{text-align:center;color:var(--muted);padding:45px 15px;background:var(--panel);border:1px dashed var(--line);border-radius:18px}.cover{width:100%;max-height:480px;object-fit:cover;border-radius:18px;border:1px solid var(--line)}.video{margin-top:14px;aspect-ratio:16/9;border-radius:18px;overflow:hidden;background:#000}.video iframe{width:100%;height:100%;border:0}.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.actions a,.actions button,.watched{min-height:50px;border:0;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;font-weight:800}.youtube{background:#ff0033;color:#fff}.actions button{background:var(--panel2);color:var(--text);border:1px solid var(--line)}.watched{width:100%;margin-top:10px;background:#32d18a12;color:var(--good);border:1px solid #32d18a33}.social{text-align:center;border-top:1px solid var(--line);padding:25px}.social p{font-size:11px;color:var(--muted)}.social div{display:flex;justify-content:center;gap:12px}.social a{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;color:white;box-shadow:0 8px 20px #0002;transition:.2s}.social a:active{transform:scale(.94)}.social svg{width:23px;height:23px;fill:currentColor}.fb{background:#1877F2}.ig{background:radial-gradient(circle at 30% 105%,#fdf497 0 5%,#fd5949 45%,#d6249f 60%,#285AEB 90%)}.tg{background:#26A5E4}.yt{background:#FF0000}footer{text-align:center;padding:18px;color:var(--muted);font-size:10px}footer span{display:inline-flex;align-items:center;gap:5px;margin-top:5px}footer a{display:grid;place-items:center;width:24px;height:24px;border:1px solid var(--line);border-radius:7px;color:var(--text);text-decoration:none}.modal{display:none;position:fixed;inset:0;z-index:100;align-items:center;justify-content:center;padding:18px}.modal.show{display:flex}.shade{position:absolute;inset:0;background:#000b;backdrop-filter:blur(8px)}.dialog{position:relative;width:min(500px,100%);max-height:88vh;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:22px;padding:27px;text-align:center;animation:pop .25s ease;box-shadow:0 30px 80px #0009}.close{position:absolute;left:12px;top:10px;border:0;background:var(--soft);color:var(--text);width:34px;height:34px;border-radius:50%;display:grid;place-items:center}.dialog p{color:var(--muted);line-height:2;font-size:12px}.warningIcon,.errorIcon,.successIcon{width:58px;height:58px;margin:0 auto 12px;border-radius:18px;display:grid;place-items:center}.warningIcon{background:#ef444414;color:#ef5555}.errorIcon{background:#ef444414;color:#ef5555}.successIcon{background:#32d18a14;color:var(--good)}.warningIcon svg,.errorIcon svg,.successIcon svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.8}.notice{border-right:3px solid #ef5555;background:#ef444410;padding:13px;border-radius:12px;color:var(--text)!important}.ack,.modalAction{width:100%;min-height:48px;border:0;border-radius:13px;background:linear-gradient(135deg,var(--accent2),var(--accent));color:#18120a;font-weight:900;margin-top:10px}.themeMenu{display:none;position:fixed;top:65px;left:20px;z-index:80;background:var(--panel);border:1px solid var(--line);padding:7px;border-radius:14px;box-shadow:0 15px 45px #0005}.themeMenu.show{display:grid;gap:5px}.themeMenu button{border:0;background:var(--soft);color:var(--text);padding:9px 18px;border-radius:9px;display:flex;align-items:center;gap:8px}.swatch{width:13px;height:13px;border-radius:50%;border:1px solid var(--line)}.swatch.dark{background:#07101f}.swatch.light{background:#fff}.swatch.pink{background:#ef7aad}@keyframes pop{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:none}}
.form{text-align:right}.form h2{text-align:center}.field{margin:11px 0}.field label{display:block;color:var(--muted);font-size:11px;margin-bottom:5px}.field input,.field select{width:100%;min-height:48px;border-radius:12px;border:1px solid var(--line);background:var(--bg);color:var(--text);padding:10px 12px;outline:none}.field input:focus,.field select:focus{border-color:var(--accent)}.formGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.formMsg{min-height:20px;color:var(--danger);font-size:11px;text-align:center}.adminHead{display:flex;justify-content:space-between;align-items:flex-start}.ghost{border:1px solid var(--line);background:var(--soft);color:var(--muted);border-radius:12px;padding:9px 12px}.adminStats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:16px}.adminStats div{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:14px;text-align:center}.adminStats b{display:block;color:var(--accent);font-size:22px}.adminStats span{font-size:10px;color:var(--muted)}.addBtn{width:100%;max-width:none;background:var(--panel2);color:var(--accent);border:1px dashed color-mix(in srgb,var(--accent) 45%,transparent);margin-bottom:16px}.adminCard{display:grid;grid-template-columns:70px 1fr auto;gap:12px;align-items:center;background:var(--panel);border:1px solid var(--line);border-radius:17px;padding:10px}.adminCard img{width:70px;height:58px;object-fit:cover;border-radius:11px;background:var(--soft)}.adminCard h3{font-size:12px;margin:0}.adminCard small{color:var(--muted)}.adminActions{display:grid;grid-template-columns:repeat(2,38px);gap:6px}.adminActions button{width:38px;height:38px;border:1px solid var(--line);background:var(--soft);color:var(--text);border-radius:10px;display:grid;place-items:center}.adminActions .delete{color:var(--danger)}.saveDock{position:sticky;bottom:10px;margin-top:18px}.saveDock .primary{width:100%;max-width:none}.toggleRow{display:flex;align-items:center;justify-content:space-between;background:var(--soft);border-radius:12px;padding:10px 12px;margin:11px 0}.toggle{width:48px;height:27px;border:0;border-radius:99px;background:#64748b;position:relative}.toggle:after{content:"";position:absolute;width:21px;height:21px;top:3px;right:3px;background:white;border-radius:50%;transition:.2s}.toggle.on{background:var(--good)}.toggle.on:after{right:24px}.installChoices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}.installChoices button{min-height:90px;border:1px solid var(--line);background:var(--soft);color:var(--text);border-radius:15px;font-weight:800}.complete{color:var(--good);text-align:center;font-size:12px;margin:10px 0;animation:pop .4s ease}
@media(max-width:680px){.hero.active{display:flex;flex-direction:column;padding-top:5px}.teacher{height:340px;width:100%}.teacher img{max-height:340px}.halo{width:270px;height:270px;bottom:25px}.heroText{text-align:center;width:100%}.hero h1{font-size:38px}.lesson{grid-template-columns:105px 1fr 48px}.lesson img{width:105px}.lesson h3{font-size:11px}.actions{grid-template-columns:1fr}.bar{padding:0 12px}.brand small{font-size:9px}.adminCard{grid-template-columns:58px 1fr auto}.adminCard img{width:58px;height:52px}.formGrid{grid-template-columns:1fr}}
.adminTabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 16px}.adminTab{min-height:46px;border:1px solid var(--line);border-radius:13px;background:var(--soft);color:var(--muted);font-weight:800}.adminTab.active{background:color-mix(in srgb,var(--accent) 14%,var(--panel));color:var(--accent);border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}.sectionAdminCard{grid-template-columns:52px 1fr auto}.sectionBadge{width:48px;height:48px;border-radius:12px;background:var(--soft);color:var(--accent);display:grid;place-items:center;font-weight:900}.adminCard .meta{font-size:10px;color:var(--muted);margin-top:3px}

.adminTabs{grid-template-columns:repeat(3,1fr)}.analyticsGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px}.metric,.analyticsBox{background:var(--panel);border:1px solid var(--line);border-radius:17px;padding:16px}.metric{text-align:center}.metric b{display:block;color:var(--accent);font-size:25px}.metric span{font-size:10px;color:var(--muted)}.analyticsBox{margin-bottom:14px}.analyticsTitle{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.analyticsTitle h3{margin:0;font-size:14px}.analyticsTitle small{color:var(--muted);font-size:9px}.deviceStats,.recentVisitors{display:flex;flex-direction:column;gap:9px}.deviceRow{padding:10px 0;border-bottom:1px solid var(--line)}.deviceRow:last-child{border-bottom:0}.deviceRow>div:first-child,.recentRow{display:flex;align-items:center;justify-content:space-between;gap:10px}.deviceRow b,.recentRow b{font-size:11px}.deviceRow span,.recentRow span{font-size:9px;color:var(--muted)}.deviceBar{height:6px;background:var(--soft);border-radius:10px;overflow:hidden;margin-top:8px}.deviceBar i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));border-radius:10px}.recentRow{padding:11px 2px;border-bottom:1px solid var(--line)}.recentRow:last-child{border-bottom:0}.privacyNote{text-align:center;color:var(--muted);font-size:9px;line-height:1.8}@media(max-width:680px){.analyticsGrid{grid-template-columns:repeat(2,1fr)}.adminTabs{grid-template-columns:1fr}.adminTab{min-height:42px}}

/* V2.6 - Zoom live sessions */
.zoomLive{width:min(100%,420px);min-height:56px;padding:11px 18px;border-radius:15px;font-weight:900;margin-top:10px;display:inline-flex;align-items:center;justify-content:center;gap:11px;border:1px solid #2d8cff66;background:linear-gradient(135deg,#2d8cff22,#2d8cff10);color:#62a8ff;box-shadow:0 10px 28px #2d8cff12;transition:.2s}.zoomLive:active{transform:scale(.985)}.zoomLogo{width:34px;height:34px;border-radius:10px;background:#2d8cff;color:#fff;display:grid;place-items:center;box-shadow:0 7px 18px #2d8cff44}.zoomLogo svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.zoomModalIcon{width:64px;height:64px;margin:0 auto 12px;border-radius:19px;background:#2d8cff;color:#fff;display:grid;place-items:center;box-shadow:0 12px 30px #2d8cff3d}.zoomModalIcon svg{width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.zoomSchedule{display:flex;align-items:center;justify-content:center;gap:12px;margin:14px 0;padding:13px 16px;border-radius:14px;background:#2d8cff12;border:1px solid #2d8cff38}.zoomSchedule span{font-weight:800}.zoomSchedule strong{direction:ltr;font-size:20px;color:#62a8ff}

/* V2.8 - Subjects + Gestion Maktaba */
.subjectGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;max-width:900px;margin:0 auto}.subjectCard{min-height:180px;border:1px solid var(--line);border-radius:22px;background:linear-gradient(145deg,var(--panel),var(--panel2));color:var(--text);padding:22px;text-align:right;display:flex;flex-direction:column;justify-content:space-between;box-shadow:0 15px 35px #0002;transition:.2s}.subjectCard:active{transform:scale(.985)}.subjectCard .subjectNo{font-size:34px;font-weight:900;color:var(--accent);opacity:.8}.subjectCard h3{font-size:19px;margin:12px 0 5px}.subjectCard p{font-size:11px;color:var(--muted);margin:0}.gestionCard{width:min(100%,420px);min-height:72px;margin-top:10px;padding:8px 12px;border:1px solid var(--line);border-radius:16px;background:var(--panel);display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--text);box-shadow:0 10px 28px #0002}.gestionCard img{width:54px;height:54px;border-radius:13px;object-fit:cover}.gestionCard span{display:flex;flex-direction:column;text-align:right}.gestionCard b{font-size:13px}.gestionCard small{font-size:9px;color:var(--muted);margin-top:3px}.adminSubjectPicker{margin:8px 0 16px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:15px}.adminSubjectPicker label{display:block;font-size:10px;color:var(--muted);margin-bottom:6px}.adminSubjectPicker select{width:100%;min-height:45px;border:1px solid var(--line);border-radius:11px;background:var(--bg);color:var(--text);padding:8px 10px}.title .subjectName{color:var(--accent)}
@media(max-width:680px){.subjectGrid{grid-template-columns:1fr}.subjectCard{min-height:130px}.gestionCard{margin-left:auto;margin-right:auto}}

/* V2.9 */
.adminTabs{grid-template-columns:repeat(4,1fr)}
@media(max-width:680px){.adminTabs{grid-template-columns:repeat(2,1fr)}}

.plansBtn{width:min(100%,620px);min-height:58px;margin:0 auto 18px;padding:12px 18px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(135deg,var(--panel),var(--panel2));color:var(--text);display:flex;align-items:center;justify-content:center;gap:10px;text-decoration:none;font-weight:900;box-shadow:0 10px 28px #0002}.plansBtn svg{width:22px;height:22px;fill:none;stroke:var(--accent);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.plansBtn:active{transform:scale(.985)}.plansBtn.hidden{display:none}

/* ===== Standalone PDF cards ===== */
.pdfLesson{
  cursor:pointer;
}

.pdfLessonIcon{
  width:92px;
  height:70px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#dc2626,#991b1b);
  box-shadow:0 8px 24px rgba(220,38,38,.20);
  flex-shrink:0;
}

.pdfLessonIcon svg{
  width:34px;
  height:34px;
  fill:none;
  stroke:#fff;
  stroke-width:1.8;
}

.pdfLesson .info small{
  color:#ef4444;
  font-weight:800;
}

.pdfLesson .eye svg{
  stroke:#ef4444;
}


/* ===== SMART ADMIN CONTENT ===== */
.adminPdfThumb{
  width:70px;
  height:58px;
  border-radius:11px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#dc2626,#991b1b);
  color:#fff;
}

.adminPdfThumb svg{
  width:28px;
  height:28px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
}

.contentTypeBadge{
  display:inline-block;
  color:var(--accent)!important;
  font-weight:800;
  margin-bottom:3px;
}

@media(max-width:680px){
  .adminPdfThumb{
    width:58px;
    height:52px;
  }
}


/* =========================================================
   ZOOM BAC 2027 — PREMIUM THEME ENGINE
   Visual layer only. Does not modify lessons/admin logic.
   ========================================================= */

:root{
  --theme-image:none;
  --theme-overlay:
    radial-gradient(circle at 80% 10%,rgba(216,173,88,.12),transparent 32%),
    radial-gradient(circle at 15% 75%,rgba(30,83,135,.12),transparent 35%),
    linear-gradient(155deg,#07101f 0%,#0a1527 50%,#07101f 100%);
  --glass:rgba(15,27,45,.78);
  --glass-strong:rgba(10,20,35,.92);
  --theme-glow:rgba(216,173,88,.20);
}

/* BASIC — الوضع الافتراضي الحديث */
body[data-theme="basic"]{
  --bg:#07101f;
  --panel:#101c2e;
  --panel2:#14233a;
  --text:#f8fafc;
  --muted:#91a0b5;
  --accent:#d8ad58;
  --accent2:#f3d98e;
  --line:#ffffff16;
  --soft:#ffffff09;
  --good:#32d18a;
  --danger:#f05252;
  --shadow:#0008;
  --theme-image:none;
  --theme-overlay:
    radial-gradient(circle at 80% 5%,rgba(216,173,88,.14),transparent 28%),
    radial-gradient(circle at 12% 70%,rgba(32,91,151,.14),transparent 35%),
    linear-gradient(150deg,#07101f 0%,#0b1729 46%,#07101f 100%);
  --glass:rgba(14,27,46,.80);
  --glass-strong:rgba(8,17,31,.94);
  --theme-glow:rgba(216,173,88,.22);
}

/* DAY */
body[data-theme="day"]{
  --bg:#f7f1ef;
  --panel:rgba(255,255,255,.84);
  --panel2:rgba(255,248,250,.90);
  --text:#2c2530;
  --muted:#746775;
  --accent:#b47756;
  --accent2:#d69a79;
  --line:rgba(80,50,65,.13);
  --soft:rgba(255,255,255,.48);
  --good:#258b65;
  --danger:#d74b58;
  --shadow:rgba(70,40,55,.18);
  --theme-image:url("https://i.ibb.co/XZ9C6cqS/file-0000000010748210bdf38db1f6b90454.png");
  --theme-overlay:linear-gradient(rgba(255,248,248,.35),rgba(249,241,242,.58));
  --glass:rgba(255,255,255,.73);
  --glass-strong:rgba(255,255,255,.91);
  --theme-glow:rgba(201,123,115,.22);
}

/* NIGHT */
body[data-theme="night"]{
  --bg:#050913;
  --panel:rgba(9,18,35,.84);
  --panel2:rgba(15,29,52,.88);
  --text:#f2f7ff;
  --muted:#9aacc4;
  --accent:#72aee8;
  --accent2:#acd7ff;
  --line:rgba(165,206,255,.14);
  --soft:rgba(91,148,210,.08);
  --good:#46d6a0;
  --danger:#ff6571;
  --shadow:#000a;
  --theme-image:url("https://i.ibb.co/Q7cHRHr6/file-00000000a6c08210b0f036feacded412.png");
  --theme-overlay:linear-gradient(rgba(3,8,18,.50),rgba(4,10,21,.74));
  --glass:rgba(6,15,30,.72);
  --glass-strong:rgba(5,12,24,.92);
  --theme-glow:rgba(85,164,236,.24);
}

/* CALM */
body[data-theme="calm"]{
  --bg:#0b2222;
  --panel:rgba(17,48,46,.82);
  --panel2:rgba(24,61,57,.88);
  --text:#f2fbf8;
  --muted:#a5c4bd;
  --accent:#80cdb5;
  --accent2:#b7ebdb;
  --line:rgba(196,242,227,.14);
  --soft:rgba(146,218,197,.08);
  --good:#79deb8;
  --danger:#ff7373;
  --shadow:#001b18aa;
  --theme-image:url("https://i.ibb.co/j9vfxMSV/file-00000000d7f882108cdddcb345ff3cd1.png");
  --theme-overlay:linear-gradient(rgba(5,27,25,.43),rgba(6,31,29,.70));
  --glass:rgba(10,40,37,.70);
  --glass-strong:rgba(8,31,30,.92);
  --theme-glow:rgba(116,211,181,.22);
}

/* PINK */
body[data-theme="pink"]{
  --bg:#321b2b;
  --panel:rgba(80,38,67,.78);
  --panel2:rgba(101,48,82,.82);
  --text:#fff6fb;
  --muted:#e1b9cf;
  --accent:#ff8fbd;
  --accent2:#ffc0da;
  --line:rgba(255,210,232,.17);
  --soft:rgba(255,157,199,.10);
  --good:#79deb2;
  --danger:#ff657d;
  --shadow:#250b1daa;
  --theme-image:url("https://i.ibb.co/WvhML5tm/file-0000000035688210a1cb374a8901eb01.png");
  --theme-overlay:linear-gradient(rgba(50,18,42,.38),rgba(48,18,40,.68));
  --glass:rgba(65,27,55,.68);
  --glass-strong:rgba(52,21,45,.91);
  --theme-glow:rgba(255,126,184,.25);
}

/* CLASSIC */
body[data-theme="classic"]{
  --bg:#1d160f;
  --panel:rgba(52,39,27,.83);
  --panel2:rgba(68,50,32,.88);
  --text:#fff8e9;
  --muted:#c8b89c;
  --accent:#d5aa62;
  --accent2:#f2d49b;
  --line:rgba(241,210,155,.15);
  --soft:rgba(222,181,108,.08);
  --good:#7fc79a;
  --danger:#e56a62;
  --shadow:#130c06bb;
  --theme-image:url("https://i.ibb.co/274q5jdH/file-00000000fbd882108ab691ed41713b07.png");
  --theme-overlay:linear-gradient(rgba(29,19,11,.43),rgba(31,21,13,.72));
  --glass:rgba(43,31,21,.72);
  --glass-strong:rgba(34,24,16,.93);
  --theme-glow:rgba(213,170,98,.23);
}

/* BLOOD MOON */
body[data-theme="blood"]{
  --bg:#160607;
  --panel:rgba(47,12,14,.83);
  --panel2:rgba(65,15,18,.88);
  --text:#fff5f4;
  --muted:#d3aaa8;
  --accent:#e84a45;
  --accent2:#ff8179;
  --line:rgba(255,126,117,.17);
  --soft:rgba(220,55,49,.10);
  --good:#69d69d;
  --danger:#ff4747;
  --shadow:#090000cc;
  --theme-image:url("https://i.ibb.co/RkC2Dn3Q/file-00000000dcf48210be7185c06bfb4535.png");
  --theme-overlay:linear-gradient(rgba(24,3,4,.43),rgba(25,4,5,.72));
  --glass:rgba(42,8,10,.70);
  --glass-strong:rgba(31,5,7,.93);
  --theme-glow:rgba(232,74,69,.27);
}

/* الخلفية على كامل المنصة */
body{
  position:relative;
  background:var(--bg);
  background-image:var(--theme-overlay),var(--theme-image);
  background-size:cover;
  background-position:center center;
  background-attachment:fixed;
  background-repeat:no-repeat;
  transition:background-color .45s ease,color .35s ease;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(circle at 50% -15%,var(--theme-glow),transparent 42%);
}

/* جعل عناصر المنصة متوافقة مع الصور */
.bar{
  background:color-mix(in srgb,var(--glass-strong) 88%,transparent)!important;
  box-shadow:0 8px 35px rgba(0,0,0,.08);
}

.subjectCard,.chapter,.topic,.lesson,.progressBox,
.adminCard,.adminStats>div,.analyticsBox,.metric,
.plansBtn,.actions>a,.actions>button,.watched{
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.subjectCard,.chapter,.topic,.lesson,.progressBox,
.adminCard,.analyticsBox,.metric{
  background:var(--glass)!important;
  border-color:var(--line)!important;
}

/* ========================================
   PREMIUM THEME PICKER
   ======================================== */

.premiumThemeMenu{
  position:fixed!important;
  inset:0!important;
  display:block!important;
  visibility:hidden;
  opacity:0;
  z-index:9999!important;
  pointer-events:none;
  transition:opacity .28s ease,visibility .28s ease;
}

.premiumThemeMenu.show{
  visibility:visible;
  opacity:1;
  pointer-events:auto;
}

.themeBackdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.58);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
}

.themeSheet{
  position:absolute;
  left:50%;
  bottom:0;
  width:min(100%,560px);
  max-height:88vh;
  overflow:auto;
  transform:translate(-50%,105%);
  padding:10px 18px calc(22px + env(safe-area-inset-bottom));
  background:color-mix(in srgb,var(--glass-strong) 97%,transparent);
  border:1px solid var(--line);
  border-bottom:0;
  border-radius:28px 28px 0 0;
  box-shadow:0 -25px 70px rgba(0,0,0,.35);
  transition:transform .42s cubic-bezier(.2,.85,.25,1);
}

.premiumThemeMenu.show .themeSheet{
  transform:translate(-50%,0);
}

.themeHandle{
  width:42px;
  height:5px;
  border-radius:999px;
  background:var(--line);
  margin:0 auto 16px;
}

.themeSheetHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:15px;
  margin-bottom:18px;
}

.themeSheetHead small{
  color:var(--accent);
  font-weight:800;
}

.themeSheetHead h2{
  margin:2px 0 2px;
  font-size:24px;
}

.themeSheetHead p{
  margin:0;
  color:var(--muted);
  font-size:12px;
}

.themeClose{
  width:40px;
  height:40px;
  flex:0 0 40px;
  border:1px solid var(--line);
  border-radius:13px;
  color:var(--text);
  background:var(--soft);
  font-size:25px;
  line-height:1;
}

.themeGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.themeChoice{
  position:relative;
  padding:0;
  overflow:hidden;
  text-align:right;
  border:1px solid var(--line);
  border-radius:19px;
  background:var(--soft);
  color:var(--text);
  cursor:pointer;
  transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease;
}

.themeChoice:active{
  transform:scale(.96);
}

.themeChoice.active{
  border-color:var(--accent);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 20%,transparent),
             0 12px 30px var(--shadow);
}

.themePreview{
  display:block;
  height:92px;
  background-size:cover;
  background-position:center;
  position:relative;
}

.themePreview::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(transparent,rgba(0,0,0,.20));
}

.basicPreview{
  background:
    radial-gradient(circle at 75% 15%,rgba(216,173,88,.42),transparent 30%),
    radial-gradient(circle at 15% 80%,rgba(41,104,170,.34),transparent 34%),
    linear-gradient(145deg,#07101f,#13243b);
}

.basicPreview i{
  position:absolute;
  width:45px;
  height:45px;
  border-radius:50%;
  right:18px;
  top:20px;
  background:rgba(216,173,88,.18);
  border:1px solid rgba(243,217,142,.30);
  box-shadow:0 0 25px rgba(216,173,88,.22);
}

.dayPreview{background-image:url("https://i.ibb.co/XZ9C6cqS/file-0000000010748210bdf38db1f6b90454.png")}
.nightPreview{background-image:url("https://i.ibb.co/Q7cHRHr6/file-00000000a6c08210b0f036feacded412.png")}
.calmPreview{background-image:url("https://i.ibb.co/j9vfxMSV/file-00000000d7f882108cdddcb345ff3cd1.png")}
.pinkPreview{background-image:url("https://i.ibb.co/WvhML5tm/file-0000000035688210a1cb374a8901eb01.png")}
.classicPreview{background-image:url("https://i.ibb.co/274q5jdH/file-00000000fbd882108ab691ed41713b07.png")}
.bloodPreview{background-image:url("https://i.ibb.co/RkC2Dn3Q/file-00000000dcf48210be7185c06bfb4535.png")}

.themeChoiceInfo{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:6px;
  padding:11px 12px 12px;
}

.themeChoiceInfo b{
  font-size:13px;
}

.themeChoiceInfo small{
  color:var(--muted);
  font-size:9px;
}

.themeCheck{
  position:absolute;
  top:8px;
  left:8px;
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--accent);
  color:#fff;
  font-weight:900;
  opacity:0;
  transform:scale(.5);
  transition:.2s ease;
  box-shadow:0 4px 15px rgba(0,0,0,.25);
}

.themeChoice.active .themeCheck{
  opacity:1;
  transform:scale(1);
}

.themeSavedHint{
  margin:15px 0 0;
  text-align:center;
  color:var(--muted);
  font-size:10px;
}

/* الصورة لا تفسد لوحة المشرف */
body[data-theme]:has(#admin.active){
  background-color:var(--bg);
}

/* انتقال لطيف بين الأوضاع */
body.themeChanging #app{
  animation:themePulse .38s ease;
}

@keyframes themePulse{
  0%{opacity:.82;filter:blur(1px)}
  100%{opacity:1;filter:none}
}

@media(max-width:520px){
  body{background-attachment:scroll}
  .themeSheet{max-height:91vh}
  .themePreview{height:82px}
}

@media(max-width:360px){
  .themeGrid{gap:8px}
  .themePreview{height:72px}
  .themeChoiceInfo{padding:9px}
}

@media(prefers-reduced-motion:reduce){
  .themeSheet,.premiumThemeMenu,.themeChoice,body{
    transition:none!important;
  }
  body.themeChanging #app{animation:none!important}
}

/* COSMIC THEME */
.cosmicPreview{
  background-image:url("https://i.ibb.co/qLbPMLfk/file-0000000072008243878ed52fe77353b0.png");
}

body[data-theme="cosmic"]{
  --bg:#050817;
  --panel:#0a1024;
  --card:#0d1530;
  --accent:#a987ff;
  --accent2:#57bfff;
  --text:#f7f4ff;
  --muted:#aab4d6;
  --line:rgba(169,135,255,.24);

  background-image:
    linear-gradient(rgba(3,6,20,.32),rgba(3,6,20,.52)),
    url("https://i.ibb.co/qLbPMLfk/file-0000000072008243878ed52fe77353b0.png");

  background-size:cover;
  background-position:center top;
  background-attachment:fixed;
  background-repeat:no-repeat;
}


/* ===== ABDELFETTAH WELCOME BACKGROUND ONLY ===== */

#zbWelcome{
  background:
    linear-gradient(
      180deg,
      rgba(5,8,12,.18) 0%,
      rgba(5,7,10,.25) 45%,
      rgba(4,5,8,.52) 100%
    ),
    url("https://i.ibb.co/23b5MmGV/file-00000000c9a0820ab68b5e2fb7a9bc9f.png")
    center center / cover no-repeat !important;
}

/* ==================================================
   ABDELFETTAH — ISLAMIC WELCOME BACKGROUND
   الخلفية فقط - لا تغيير في المنصة
   ================================================== */

#zbWelcome.zbWelcome{
  position:fixed !important;
  isolation:isolate !important;
  overflow:hidden !important;
  background:#07101f !important;
}

/* الصورة الإسلامية */
#zbWelcome.zbWelcome::before{
  content:"" !important;
  position:absolute !important;
  inset:-3% !important;
  z-index:-2 !important;

  background-image:
    url("https://i.ibb.co/23b5MmGV/file-00000000c9a0820ab68b5e2fb7a9bc9f.png") !important;

  background-size:cover !important;
  background-position:center center !important;
  background-repeat:no-repeat !important;

  opacity:1 !important;

  animation:zbIslamicBackgroundMove 16s ease-in-out infinite alternate !important;
  will-change:transform;
}

/* طبقة خفيفة حتى تبقى الكتابة واضحة */
#zbWelcome.zbWelcome::after{
  content:"" !important;
  position:absolute !important;
  inset:0 !important;
  z-index:-1 !important;
  pointer-events:none !important;

  background:
    linear-gradient(
      180deg,
      rgba(3,8,16,.12) 0%,
      rgba(3,7,14,.08) 35%,
      rgba(3,6,12,.25) 70%,
      rgba(2,5,10,.42) 100%
    ) !important;
}

/* إبقاء عناصر البداية فوق الخلفية */
#zbWelcome .zbWelcomeGlow,
#zbWelcome .zbWelcomeCard{
  position:relative !important;
  z-index:2 !important;
}

/* حركة سينمائية بطيئة جداً */
@keyframes zbIslamicBackgroundMove{
  0%{
    transform:scale(1.04) translate3d(0,0,0);
  }

  100%{
    transform:scale(1.10) translate3d(0,-1%,0);
  }
}

@media (prefers-reduced-motion:reduce){
  #zbWelcome.zbWelcome::before{
    animation:none !important;
    transform:scale(1.04) !important;
  }
}

