/* ============================================================
   أكاديمية أحمد شوقي — هوية التصميم الكاملة
   Apple-style rounded UI · RTL · عصري وشبابي
   ============================================================ */

:root {
  /* الخلفية الأساسية */
  --bg-dark-start: #0F2C38;
  --bg-dark-end: #05141A;
  --bg-gradient: linear-gradient(160deg, var(--bg-dark-start), var(--bg-dark-end));

  /* اللون المميز — أخضر ليموني */
  --accent-green: #8DC63F;
  --accent-green-light: #A9E24C;
  --accent-green-deep: #5FA524;
  --accent-green-gradient: linear-gradient(135deg, var(--accent-green-light), var(--accent-green-deep));

  /* عناصر ثانوية */
  --card-black: #12151A;
  --card-black-soft: #1B1F26;
  --text-white: #FFFFFF;
  --text-muted: #AFC0C0;
  --text-muted-2: #7C8B8B;
  --accent-purple: #8B5CF6;

  /* حالات */
  --success: #4CAF1F;
  --danger: #E5484D;
  --warning: #F5B301;

  /* هندسة الشكل */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 30px rgba(141, 198, 63, 0.28);
  --container: 1180px;
}

/* ========== RESET ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Tajawal', sans-serif;
  background: #F6F8F7;
  color: #12151A;
  overflow-x: hidden;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: none; cursor: pointer; font-family: 'Tajawal', sans-serif;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.btn-sm { padding: 10px 22px; font-size: 14px; }
.btn-full { width: 100%; padding: 15px; font-size: 15.5px; margin-top: 6px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-green-light), var(--accent-green-deep));
  color: #08170a;
}
.btn-primary:hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow-glow); }
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: #fff; border: 1px solid rgba(255,255,255,0.25);
}
.btn-ghost:hover { background: rgba(255,255,255,0.14); transform: translateY(-3px); }
.btn-outline {
  background: transparent;
  color: var(--accent-green-deep); border: 2px solid var(--accent-green);
}
.btn-outline:hover {
  background: var(--accent-green); color: #08170a;
  transform: translateY(-2px);
}

/* ========== NAVBAR ========== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 0;
  transition: all .35s ease;
  background: rgba(5, 20, 26, 0.92);
}
.site-header.scrolled {
  background: rgba(5, 20, 26, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 12px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.nav { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #fff; white-space: nowrap; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-green-light), var(--accent-green-deep));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fira Code', monospace; font-weight: 700; color: #08120a; font-size: 14px;
  box-shadow: var(--shadow-glow);
}
.logo-image {
  height: 38px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 8px;
}
.nav-links { display: flex; gap: 34px; align-items: center; }
.nav-links a {
  color: #E7EFEF; font-size: 15px; font-weight: 500;
  position: relative; padding: 4px 0; transition: color .25s;
}
.nav-links a:hover { color: var(--accent-green-light); }
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; right: 0; width: 0; height: 2px;
  background: var(--accent-green-light); transition: width .3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.hello { color: #DCE6E6; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* Burger Menu (Mobile) */
.burger {
  display: none; width: 26px; height: 20px; position: relative; background: none; border: none;
}
.burger span {
  position: absolute; right: 0; width: 100%; height: 2px;
  background: #fff; border-radius: 2px; transition: .3s;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 9px; }
.burger span:nth-child(3) { top: 18px; }

/* Mobile Nav */
.mobile-nav {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5,20,26,0.97); z-index: 99;
  flex-direction: column; align-items: center; justify-content: center; gap: 28px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { color: #fff; font-size: 20px; font-weight: 700; }
.mobile-nav a:hover { color: var(--accent-green-light); }
.mobile-close { position: absolute; top: 24px; left: 24px; background: none; border: none; color: #fff; font-size: 32px; cursor: pointer; }

/* ========== HERO ========== */
.hero {
  background: linear-gradient(155deg, var(--bg-dark-start), var(--bg-dark-end) 70%);
  padding: 170px 0 120px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(141,198,63,0.14), transparent 70%);
  top: -200px; left: -150px; pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(141,198,63,0.12); border: 1px solid rgba(141,198,63,0.35);
  color: var(--accent-green-light); font-size: 13px; font-weight: 700;
  padding: 7px 16px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot { width: 7px; height: 7px; background: var(--accent-green-light); border-radius: 50%; }
.hero h1 {
  font-size: 52px; line-height: 1.28; font-weight: 900; color: #fff; margin-bottom: 20px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-green-light), var(--accent-green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead {
  font-size: 17px; line-height: 1.9; color: var(--text-muted);
  max-width: 520px; margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 16px; margin-bottom: 44px; flex-wrap: wrap; }
.trust-row { display: flex; gap: 26px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 9px; color: #D7E4E4; font-size: 14px; font-weight: 500; }
.trust-item svg { width: 18px; height: 18px; stroke: var(--accent-green-light); flex-shrink: 0; }

/* Code Card Widget */
.code-card {
  background: var(--card-black); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft), 0 0 60px rgba(141,198,63,0.08);
  border: 1px solid rgba(255,255,255,0.06); overflow: hidden;
}
.code-topbar {
  display: flex; align-items: center; gap: 8px; padding: 14px 18px;
  background: var(--card-black-soft); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.code-dot { width: 11px; height: 11px; border-radius: 50%; }
.code-dot.r { background: #FF5F57; }
.code-dot.y { background: #FEBC2E; }
.code-dot.g { background: var(--accent-green-light); }
.code-filename { margin-right: auto; font-family: 'Fira Code', monospace; font-size: 12px; color: var(--text-muted-2); }
.code-body {
  padding: 26px 24px; font-family: 'Fira Code', monospace;
  font-size: 14.5px; line-height: 2.05; direction: ltr; text-align: left;
}
.code-line {
  opacity: 0; transform: translateY(8px);
  animation: codeReveal .5s ease forwards; white-space: pre-wrap;
}
.code-line .kw { color: var(--accent-purple); }
.code-line .str { color: var(--accent-green-light); }
.code-line .fn { color: #7FB8E0; }
.code-line .cm { color: var(--text-muted-2); }
@keyframes codeReveal { to { opacity: 1; transform: translateY(0); } }
.cursor-blink {
  display: inline-block; width: 8px; height: 16px; background: var(--accent-green-light);
  margin-right: 4px; vertical-align: middle; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ========== STATS FLOAT ========== */
.stats-float { position: relative; z-index: 5; margin-top: -56px; }
.stats-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 36px 20px;
}
.stat { text-align: center; border-left: 1px solid #ECEFEF; }
.stat:last-child { border-left: none; }
.stat b { display: block; font-size: 32px; font-weight: 900; color: #0F2C38; margin-bottom: 4px; }
.stat b .accent { color: var(--accent-green-deep); }
.stat small { color: #7C8B8B; font-size: 13.5px; font-weight: 500; }

/* ========== SECTIONS ========== */
section { padding: 110px 0; }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 60px; }
.sec-eyebrow {
  color: var(--accent-green-deep); font-weight: 800; font-size: 13px;
  letter-spacing: .5px; margin-bottom: 12px; display: block;
}
.sec-head h2 { font-size: 36px; font-weight: 900; color: #0F2C38; margin-bottom: 16px; }
.sec-head p { color: #6B7A7A; font-size: 15.5px; line-height: 1.8; }

/* Scroll Reveal Animation */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ========== FEATURES ========== */
.features { background: var(--card-black); }
.features .sec-head h2 { color: #fff; }
.features .sec-head p { color: var(--text-muted); }
.features .sec-eyebrow { color: var(--accent-green-light); }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feat-card {
  background: var(--card-black-soft); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md); padding: 32px 24px;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.feat-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-glow); border-color: rgba(141,198,63,0.4); }
.feat-icon {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(141,198,63,0.18), rgba(141,198,63,0.05));
  display: flex; align-items: center; justify-content: center;
}
.feat-icon svg { width: 26px; height: 26px; stroke: var(--accent-green-light); }
.feat-card h3 { color: #fff; font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.feat-card p { color: var(--text-muted); font-size: 14px; line-height: 1.85; }

/* ========== COURSES ========== */
.courses-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 48px; flex-wrap: wrap; }
.tab-btn {
  padding: 11px 24px; border-radius: 999px; background: #fff; color: #3C4A4A;
  font-weight: 700; font-size: 14px; border: 1px solid #E3E8E8;
  transition: .3s; font-family: 'Tajawal', sans-serif; cursor: pointer;
}
.tab-btn:hover { border-color: var(--accent-green); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-green-light), var(--accent-green-deep));
  color: #08170a; border-color: transparent;
}
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.courses-empty-msg { text-align: center; padding: 34px 0; color: #7C8B8B; font-weight: 700; }
.courses-more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.course-card {
  background: #fff; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: 0 6px 24px rgba(15,44,56,0.08);
  transition: transform .35s ease, box-shadow .35s ease;
  display: flex; flex-direction: column;
}
.course-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(15,44,56,0.16); }
.course-card-locked { position: relative; }
.course-card-locked::after {
  content: "🔒\A غير متاح لسنتك الدراسية"; white-space: pre-line; text-align: center; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; line-height: 2; color: #0F2C38; background: rgba(255,255,255,0.52); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  pointer-events: none;
}
.course-card-locked .course-thumb, .course-card-locked .course-body { filter: blur(4px); }
.course-card-locked:hover { transform: none; box-shadow: 0 6px 24px rgba(15,44,56,0.08); }
.course-lock-label { color: #7C8B8B; font-size: 12.5px; font-weight: 800; }
.course-thumb {
  height: 150px; position: relative; display: flex; align-items: center; justify-content: center;
}
.course-thumb svg { width: 44px; height: 44px; stroke: rgba(255,255,255,0.92); }
.course-badge {
  position: absolute; top: 14px; left: 14px;
  background: rgba(5,20,26,0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}
.course-stage {
  position: absolute; top: 14px; right: 14px;
  background: #fff; color: #0F2C38;
  font-size: 11.5px; font-weight: 800;
  padding: 6px 13px; border-radius: 999px;
}
.course-body { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.course-body h3 { font-size: 17px; font-weight: 800; color: #12151A; margin-bottom: 10px; line-height: 1.5; }
.course-body .course-desc {
  font-size: 13.5px; color: #5C6B6B; line-height: 1.7; margin-bottom: 20px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.course-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #EFF2F2; padding-top: 16px; }
.price { font-weight: 900; font-size: 19px; color: #0F2C38; }
.price small { font-size: 12px; font-weight: 600; color: #8B9B9B; }

/* ========== EXAM DEMO SECTION ========== */
.exam-sec {
  background: linear-gradient(155deg, var(--bg-dark-start), var(--bg-dark-end) 75%);
  position: relative; overflow: hidden;
}
.exam-sec .sec-head h2 { color: #fff; }
.exam-sec .sec-head p { color: var(--text-muted); }
.exam-sec .sec-eyebrow { color: var(--accent-green-light); }
.exam-layout { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center; }
.exam-points { display: flex; flex-direction: column; gap: 22px; }
.exam-point { display: flex; gap: 16px; align-items: flex-start; }
.exam-point-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: rgba(141,198,63,0.14);
  display: flex; align-items: center; justify-content: center;
}
.exam-point-ico svg { width: 20px; height: 20px; stroke: var(--accent-green-light); }
.exam-point h4 { color: #fff; font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.exam-point p { color: var(--text-muted); font-size: 13.5px; line-height: 1.75; }
.exam-widget {
  background: var(--card-black); border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.07); box-shadow: var(--shadow-soft); padding: 26px;
}
.exam-widget-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.exam-progress-txt { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.exam-timer {
  display: flex; align-items: center; gap: 8px;
  background: rgba(141,198,63,0.12); color: var(--accent-green-light);
  font-weight: 800; font-family: 'Fira Code', monospace;
  padding: 8px 16px; border-radius: 999px; font-size: 15px;
}
.exam-timer svg { width: 16px; height: 16px; stroke: var(--accent-green-light); }
.exam-progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 6px; margin-bottom: 26px; overflow: hidden; }
.exam-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent-green), var(--accent-green-light));
  border-radius: 6px; transition: width .4s ease;
}
.exam-q { color: #fff; font-size: 16.5px; font-weight: 700; margin-bottom: 20px; line-height: 1.7; }
.exam-opts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.exam-opt {
  background: var(--card-black-soft); border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 14px 18px; color: #DCE6E6; font-size: 14.5px; font-weight: 500;
  display: flex; align-items: center; gap: 12px; transition: .25s; cursor: pointer;
}
.exam-opt .opt-letter {
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; font-family: 'Fira Code', monospace;
  color: var(--text-muted); flex-shrink: 0;
}
.exam-opt:hover:not(:disabled) { border-color: rgba(141,198,63,0.4); }
.exam-opt:disabled { cursor: default; opacity: 0.95; }
.exam-opt.selected { border-color: var(--accent-green-light); background: rgba(141,198,63,0.1); }
.exam-opt.selected .opt-letter { background: var(--accent-green-light); color: #08170a; }
.exam-opt.correct { border-color: #8FE05B; background: rgba(143,224,91,0.14); color: #F4FFF0; }
.exam-opt.correct .opt-letter { background: #8FE05B; color: #08170a; }
.exam-opt.wrong { border-color: #ff6b6b; background: rgba(255,107,107,0.12); }
.exam-opt.wrong .opt-letter { background: #ff6b6b; color: #fff; }
.exam-feedback {
  border: 1px solid rgba(143,224,91,0.25); background: rgba(143,224,91,0.08);
  color: #DFF7D5; border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.7;
}
.exam-widget-foot { display: flex; justify-content: flex-end; }
#nextQBtn:disabled { opacity: .55; cursor: not-allowed; }

/* ========== INSTRUCTOR ========== */
.instructor-wrap { display: grid; grid-template-columns: 0.42fr 0.58fr; gap: 56px; align-items: center; }
.avatar-box {
  aspect-ratio: 1/1; border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--bg-dark-start), var(--bg-dark-end));
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; box-shadow: var(--shadow-soft);
}
.avatar-box::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(141,198,63,0.25), transparent 55%);
}
.avatar-initials {
  font-family: 'Fira Code', monospace; font-weight: 700; font-size: 64px;
  color: #fff; position: relative; z-index: 2;
}
.instructor-badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 24px; }
.chip {
  background: #F0F5EE; color: var(--accent-green-deep); font-size: 12.5px; font-weight: 700;
  padding: 7px 15px; border-radius: 999px;
}
.instructor-wrap h2 { font-size: 30px; font-weight: 900; color: #0F2C38; margin-bottom: 6px; }
.instructor-wrap .role { color: #7C8B8B; font-weight: 600; font-size: 14.5px; margin-bottom: 18px; }
.instructor-wrap p.bio { color: #5C6B6B; line-height: 1.9; font-size: 15px; margin-bottom: 24px; }

/* ========== CTA / REGISTER FORM ========== */
.cta-sec {
  background: linear-gradient(155deg, var(--bg-dark-start), var(--bg-dark-end));
  border-radius: var(--radius-lg); padding: 64px;
  position: relative; overflow: hidden;
}
.cta-sec::before {
  content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(141,198,63,0.16), transparent 70%);
  bottom: -180px; left: -100px;
}
.cta-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 52px; position: relative; z-index: 2; }
.cta-grid h2 { color: #fff; font-size: 30px; font-weight: 900; margin-bottom: 16px; }
.cta-grid p { color: var(--text-muted); line-height: 1.9; font-size: 15px; margin-bottom: 22px; }
.cta-mini-list { display: flex; flex-direction: column; gap: 12px; }
.cta-mini-list div { display: flex; align-items: center; gap: 10px; color: #DCE6E6; font-size: 14px; }
.cta-mini-list svg { width: 17px; height: 17px; stroke: var(--accent-green-light); flex-shrink: 0; }

/* Registration Form */
form.reg-form { background: #fff; border-radius: var(--radius-md); padding: 30px; box-shadow: 0 24px 50px rgba(0,0,0,0.28); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field.full { grid-column: 1/-1; }
.field label { font-size: 13px; font-weight: 700; color: #3C4A4A; }
.field input, .field select, .field textarea {
  padding: 13px 15px; border-radius: 12px; border: 1.5px solid #E3E8E8;
  font-family: inherit; font-size: 14px; color: #12151A;
  transition: border-color .25s; background: #FBFCFC;
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent-green); }
.field-error { color: var(--danger); font-size: 12.5px; }
.validation-summary { color: var(--danger); font-size: 13.5px; margin-bottom: 14px; }
.validation-summary ul { margin: 0; padding-right: 18px; }

/* Auth Pages */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--bg-dark-start), var(--bg-dark-end) 75%);
  padding: 50px 20px;
}
.auth-card {
  background: #fff; width: 100%; max-width: 560px; border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35); padding: 40px;
}
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head .logo-mark { margin: 0 auto 14px; }
.auth-head h1 { font-size: 24px; font-weight: 900; color: #0F2C38; margin-bottom: 8px; }
.auth-head p { color: #7C8B8B; font-size: 14px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: #5C6B6B; }
.auth-switch a { color: var(--accent-green-deep); font-weight: 700; }

/* ========== FOOTER ========== */
footer { background: #05141A; padding: 60px 0 26px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.foot-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 16px; }
footer p.foot-desc { color: var(--text-muted-2); font-size: 13.5px; line-height: 1.9; max-width: 320px; }
footer h5 { color: #fff; font-size: 14.5px; font-weight: 700; margin-bottom: 18px; }
footer ul li { margin-bottom: 12px; }
footer ul a { color: var(--text-muted); font-size: 14px; transition: color .25s; }
footer ul a:hover { color: var(--accent-green-light); }
.foot-contact li { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 14px; }
.foot-contact svg { width: 16px; height: 16px; stroke: var(--accent-green-light); flex-shrink: 0; }
.foot-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px;
  text-align: center; color: var(--text-muted-2); font-size: 13px;
}

/* ========== SIMPLE DASHBOARDS ========== */
.simple-dashboard {
  min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; background: #F6F8F7; text-align: center; padding: 40px;
}
.simple-dashboard h1 { font-size: 26px; font-weight: 800; color: #0F2C38; }
.simple-dashboard p { color: #6B7A7A; font-size: 15px; max-width: 480px; line-height: 1.8; }
.simple-dashboard .chip { background: #F0F5EE; color: var(--accent-green-deep); }

/* ========== COURSES PAGE ========== */
.courses-page { padding-top: 120px; padding-bottom: 80px; }
.courses-page .sec-head { margin-bottom: 40px; }

/* ========== COURSE DETAILS PAGE ========== */
.course-details-hero {
  background: linear-gradient(155deg, var(--bg-dark-start), var(--bg-dark-end) 70%);
  padding: 140px 0 80px; color: #fff;
}
.course-details-hero h1 { font-size: 36px; font-weight: 900; margin-bottom: 16px; }
.course-details-hero .stage-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px;
  background: rgba(141,198,63,0.15); border: 1px solid rgba(141,198,63,0.3);
  color: var(--accent-green-light); border-radius: 999px; font-size: 13px; font-weight: 700;
  margin-bottom: 16px;
}
.course-details-hero .lead { color: var(--text-muted); font-size: 16px; line-height: 1.8; max-width: 600px; }
.course-meta {
  display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap;
}
.course-meta-item {
  display: flex; align-items: center; gap: 10px; color: #DCE6E6; font-size: 14px; font-weight: 600;
}
.course-meta-item svg { width: 18px; height: 18px; stroke: var(--accent-green-light); }
.course-content-section { padding: 60px 0; }
.lessons-list { display: flex; flex-direction: column; gap: 12px; }
.lesson-item {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  background: #fff; border-radius: var(--radius-sm); border: 1px solid #EFF2F2;
  transition: .25s;
}
.lesson-item:hover { border-color: var(--accent-green); transform: translateX(-4px); }
.lesson-num {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(141,198,63,0.15), rgba(141,198,63,0.05));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--accent-green-deep); font-size: 14px;
}
.lesson-item h4 { font-size: 15px; font-weight: 700; color: #12151A; }

/* Enrollment status alerts */
.enrollment-status {
  padding: 16px 24px; border-radius: var(--radius-sm); margin-top: 20px;
  font-size: 14px; font-weight: 600;
}
.enrollment-status.pending { background: rgba(245,179,1,0.12); color: #A67C00; border: 1px solid rgba(245,179,1,0.3); }
.enrollment-status.approved { background: rgba(76,175,31,0.12); color: #357613; border: 1px solid rgba(76,175,31,0.3); }
.enrollment-status.rejected { background: rgba(229,72,77,0.12); color: #B91C1C; border: 1px solid rgba(229,72,77,0.3); }

/* TempData alerts */
.alert {
  padding: 16px 24px; border-radius: var(--radius-sm); margin-bottom: 24px;
  font-size: 14px; font-weight: 600; text-align: center;
}
.alert-success { background: rgba(76,175,31,0.12); color: #357613; border: 1px solid rgba(76,175,31,0.3); }
.alert-error { background: rgba(229,72,77,0.12); color: #B91C1C; border: 1px solid rgba(229,72,77,0.3); }
.alert-info { background: rgba(59,130,246,0.12); color: #1D4ED8; border: 1px solid rgba(59,130,246,0.3); }

/* Course Lessons Video layout */
.course-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }

/* About Page */
.about-page { padding-top: 120px; }

/* Contact Page */
.contact-page {
  padding-top: 120px; padding-bottom: 80px;
}
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.contact-card {
  background: #fff; border-radius: var(--radius-md); padding: 32px 24px; text-align: center;
  box-shadow: 0 6px 24px rgba(15,44,56,0.08); transition: .35s;
}
.contact-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(15,44,56,0.14); }
.contact-card-ico {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px;
  background: linear-gradient(135deg, rgba(141,198,63,0.18), rgba(141,198,63,0.05));
  display: flex; align-items: center; justify-content: center;
}
.contact-card-ico svg { width: 26px; height: 26px; stroke: var(--accent-green); }
.contact-card h3 { font-size: 16px; font-weight: 800; color: #0F2C38; margin-bottom: 8px; }
.contact-card p { color: #5C6B6B; font-size: 14px; line-height: 1.7; }
.contact-card a { color: var(--accent-green-deep); font-weight: 700; }

/* ========== RESPONSIVE ========== */
@media (max-width: 980px) {
  .hero-grid, .exam-layout, .instructor-wrap, .cta-grid, .course-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
  .sec-head h2 { font-size: 30px; }
  .instructor-wrap h2, .cta-grid h2, .course-details-hero h1 { font-size: 28px; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-card { grid-template-columns: 1fr; gap: 20px; }
  .stat { border-left: none; border-bottom: 1px solid #ECEFEF; padding-bottom: 16px; }
  .stat:last-child { border-bottom: none; padding-bottom: 0; }
  .nav-links { display: none; }
  .burger { display: block; }
  .hello { display: none; }
  .nav-cta .btn-ghost, .nav-cta .btn-primary { display: none; }
  /*.nav-cta form { display: none; }*/
  .cta-sec { padding: 40px 26px; }
  .form-row { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .hero { padding: 130px 0 90px; }
  .hero h1 { font-size: 26px; }
  .sec-head h2 { font-size: 22px; }
  .instructor-wrap h2, .cta-grid h2 { font-size: 22px; }
  .feat-grid { grid-template-columns: 1fr; }
  .feat-card { padding: 24px 20px; }
  .feat-card h3 { font-size: 15px; }
  .feat-card p { font-size: 13px; }
  .course-grid { grid-template-columns: 1fr; }
  section { padding: 70px 0; }
  .foot-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .course-details-hero h1 { font-size: 22px; }
  .simple-dashboard h1 { font-size: 20px; }
  .course-meta { gap: 16px; }
  .btn { padding: 11px 20px; font-size: 14px; }
  .btn-sm { padding: 9px 16px; font-size: 13px; }
  .logo { font-size: 16px; }
  .logo-mark { width: 32px; height: 32px; font-size: 12px; }
  .wrap { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* ============ الإشعارات ============ */
.notif-wrap { position: relative; display: inline-flex; align-items: center; }

.notif-bell {
  position: relative;
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.notif-bell:hover { background: rgba(255,255,255,0.08); }

.notif-badge {
  position: absolute; top: 0; left: 0;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-dark-start);
}

.notif-dropdown {
  position: absolute; top: calc(100% + 12px); left: 0;
  width: 340px; max-width: 90vw;
  background: #fff; color: var(--card-black);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  overflow: hidden;
  z-index: 200;
  text-align: right;
}

.notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #EFF2F2;
  font-weight: 800; font-size: 14px;
}
.notif-dropdown-head button {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--accent-green-deep);
  padding: 0;
}
.notif-dropdown-head button:hover { text-decoration: underline; }

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item {
  display: block; padding: 12px 18px;
  border-bottom: 1px solid #F3F5F4;
  text-decoration: none; color: inherit;
  transition: background 0.15s ease;
}
.notif-item:hover { background: #F6F8F7; }
.notif-item.unread { background: rgba(141,198,63,0.08); }
.notif-item.unread .notif-item-title::before {
  content: ''; display: inline-block; width: 7px; height: 7px;
  border-radius: 999px; background: var(--accent-green); margin-left: 6px;
}

.notif-item-title { font-size: 13px; font-weight: 800; margin-bottom: 3px; }
.notif-item-msg { font-size: 12.5px; color: var(--text-muted-2); line-height: 1.6; margin-bottom: 4px; }
.notif-item-time { font-size: 11px; color: #AEB8B8; }

.notif-empty { padding: 30px 18px; text-align: center; font-size: 13px; color: var(--text-muted-2); }

.dash-chart-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) {
  .dash-chart-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 620px) {
  .notif-dropdown { position: fixed; top: 76px; left: 12px; right: 12px; width: auto; }
}
/* ============ قائمة المستخدم (الأفاتار) ============ */
.user-menu-wrap { position: relative; display: inline-flex; align-items: center; }

.user-avatar-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.25);
  cursor: pointer; padding: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: border-color 0.2s ease;
}
.user-avatar-btn:hover { border-color: var(--accent-green); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar-btn svg { width: 22px; height: 22px; }

.user-menu-dropdown {
  position: absolute; top: calc(100% + 12px); left: 0;
  width: 260px;
  background: #fff; color: var(--card-black);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  overflow: hidden;
  z-index: 200;
  text-align: right;
}

.user-menu-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid #EFF2F2;
}
.user-menu-avatar-lg {
  width: 46px; height: 46px; border-radius: 50%;
  background: #F0F2F1; color: #9AA6A6;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.user-menu-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-avatar-lg svg { width: 24px; height: 24px; }
.user-menu-name { font-size: 14px; font-weight: 800; }
.user-menu-role { font-size: 12px; color: var(--text-muted-2); margin-top: 2px; }

.user-menu-item {
  display: block; width: 100%;
  padding: 12px 18px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; color: inherit;
  background: none; border: none; text-align: right;
  cursor: pointer;
  transition: background 0.15s ease;
}
.user-menu-item:hover { background: #F6F8F7; }
.user-menu-item.danger { color: var(--danger); }

@media (max-width: 620px) {
  .user-menu-dropdown { position: fixed; top: 76px; left: 12px; right: 12px; width: auto; }
}

/* ============================================================
   صفحة الدفع — Payment Page
   ============================================================ */
.payment-hero {
  padding-top: 120px;
  padding-bottom: 60px;
  min-height: 100vh;
  background: linear-gradient(160deg, #F6F8F7 0%, #EEF2F0 100%);
}
.payment-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .payment-layout { grid-template-columns: 1fr; }
}

/* ملخص الكورس */
.payment-summary {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: 0 8px 32px rgba(15,44,56,0.08);
  position: sticky;
  top: 120px;
}
.payment-summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #EFF2F2;
}
.payment-summary-header h2 {
  font-size: 18px;
  font-weight: 900;
  color: #0F2C38;
  margin: 0;
}
.payment-course-info {
  margin-bottom: 20px;
}
.payment-course-info h3 {
  font-size: 20px;
  font-weight: 900;
  color: #0F2C38;
  margin-bottom: 8px;
}
.payment-course-info p {
  font-size: 13.5px;
  color: #5C6B6B;
  line-height: 1.7;
}
.payment-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.payment-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.payment-detail-row span { color: #7C8B8B; }
.payment-detail-row strong { color: #12151A; font-weight: 700; }
.payment-detail-row.total {
  padding-top: 16px;
  border-top: 2px solid var(--accent-green);
}
.payment-detail-row.total strong {
  font-size: 22px;
  color: var(--accent-green-deep);
  font-weight: 900;
}
.payment-divider {
  height: 1px;
  background: #EFF2F2;
  margin: 4px 0;
}

/* طرق الدفع */
.payment-action {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: 0 8px 32px rgba(15,44,56,0.08);
}
.payment-action h2 {
  font-size: 22px;
  font-weight: 900;
  color: #0F2C38;
  margin-bottom: 8px;
}
.payment-instructions {
  font-size: 14px;
  color: #5C6B6B;
  margin-bottom: 24px;
  line-height: 1.7;
}
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
.payment-method-card {
  border: 1px solid #EFF2F2;
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.payment-method-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 4px 16px rgba(141,198,63,0.1);
}
.payment-method-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.payment-method-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: #0F2C38;
  margin-bottom: 4px;
}
.payment-method-card p {
  font-size: 13px;
  color: #7C8B8B;
  line-height: 1.6;
}
.payment-number {
  background: linear-gradient(135deg, #0F2C38, #1A4050);
  color: #8DC63F;
  font-family: 'Fira Code', monospace;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 10px;
  margin-top: 10px;
  text-align: center;
  letter-spacing: 2px;
  -webkit-user-select: all; /* Safari 3+, iOS 3+ */
  user-select: all;
}

/* تأكيد الدفع */
.payment-confirm-section {
  border-top: 1px solid #EFF2F2;
  padding-top: 24px;
}
.payment-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(141,198,63,0.08);
  border: 1px solid rgba(141,198,63,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #3C4A4A;
}
.payment-confirm-btn {
  font-size: 17px !important;
  padding: 16px !important;
  font-weight: 900 !important;
}

/* ============================================================
   صفحة تأكيد الدفع — Payment Confirmation
   ============================================================ */
.payment-confirmation-section {
  min-height: 100vh;
  background: linear-gradient(160deg, #F6F8F7 0%, #EEF2F0 100%);
}
.payment-confirmation-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: 0 12px 48px rgba(15,44,56,0.1);
}
.payment-confirmation-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}
@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.payment-confirmation-card h1 {
  font-size: 28px;
  font-weight: 900;
  color: #0F2C38;
  margin-bottom: 12px;
}
.payment-confirmation-subtitle {
  font-size: 15px;
  color: #5C6B6B;
  line-height: 1.8;
  margin-bottom: 32px;
}

/* خطوات التأكيد */
.payment-confirmation-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: right;
  margin-bottom: 8px;
}
.confirmation-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-right: 3px solid #EFF2F2;
  position: relative;
}
.confirmation-step.done {
  border-right-color: var(--accent-green);
}
.confirmation-step.active {
  border-right-color: var(--accent-green);
  background: rgba(141,198,63,0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.step-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.confirmation-step h4 {
  font-size: 14px;
  font-weight: 800;
  color: #0F2C38;
  margin-bottom: 2px;
}
.confirmation-step p {
  font-size: 12.5px;
  color: #7C8B8B;
  line-height: 1.5;
}
/* ========== IQ TRAINING ========== */
.iq-layout { display: grid; grid-template-columns: 1.4fr .6fr; gap: 28px; align-items: start; }
.iq-panel, .iq-side-card {
  background: #fff; border-radius: var(--radius-md); padding: 26px;
  box-shadow: 0 6px 24px rgba(15,44,56,0.08);
}
.iq-topbar { display: flex; align-items: center; justify-content: space-between; color: #5C6B6B; font-weight: 800; margin-bottom: 14px; }
.iq-question { color: #0F2C38; font-size: 22px; font-weight: 900; line-height: 1.7; margin: 24px 0; }
.iq-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.iq-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.iq-side-card h3 { color: #0F2C38; font-size: 18px; font-weight: 900; margin-bottom: 12px; }
.iq-side-card ul { padding-right: 18px; color: #5C6B6B; line-height: 1.9; margin-bottom: 14px; }
.iq-side-card p { color: #7C8B8B; font-size: 13.5px; line-height: 1.8; }
@media (max-width: 900px) { .iq-layout { grid-template-columns: 1fr; } }
.iq-panel .exam-progress-bar { background: #E8EFEA; }
.iq-panel .exam-feedback {
  background: #F1F8EC;
  border-color: rgba(76, 175, 31, 0.25);
  color: #23451E;
  font-weight: 700;
}
.iq-option {
  background: #F8FAF9;
  border-color: #E0E8E4;
  color: #0F2C38;
  font-weight: 800;
}
.iq-option .opt-letter {
  background: #E8EFEA;
  color: #274B58;
}
.iq-option:hover:not(:disabled) {
  background: #F1F8EC;
  border-color: var(--accent-green-deep);
}
.iq-option.correct {
  background: #E9F8DF;
  border-color: #4CAF1F;
  color: #163A12;
}
.iq-option.correct .opt-letter {
  background: #4CAF1F;
  color: #fff;
}
.iq-option.wrong {
  background: #FFF0F0;
  border-color: #E5484D;
  color: #5C1517;
}
.iq-option.wrong .opt-letter {
  background: #E5484D;
  color: #fff;
}
.iq-actions .btn-ghost,
#iqRestartBtn {
  background: #0F2C38;
  border-color: #0F2C38;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15,44,56,0.16);
}
.iq-actions .btn-ghost:hover,
#iqRestartBtn:hover {
  background: #274B58;
  color: #fff;
}

/* ============ محرر الأكواد ============ */
.code-playground {
  background: #1B1F26;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.18);
}

.code-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}

.code-lang-select {
  background: #12151A; color: #fff; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}

.code-run-status { color: var(--accent-green); font-size: 13px; font-weight: 700; }

.code-editor-host {
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 14px;
}
.code-editor-host .CodeMirror {
  height: 360px; font-size: 14.5px; font-family: 'Fira Code', monospace; direction: ltr; text-align: left;
}

.code-stdin-box { margin-bottom: 14px; }
.code-stdin-box label {
  display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px;
}
.code-stdin-box textarea {
  width: 100%; background: #12151A; color: #fff; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 10px 14px; font-family: 'Fira Code', monospace; font-size: 13px;
  direction: ltr; text-align: left; resize: vertical;
}

.code-output-box {
  background: #12151A; border-radius: 12px; padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.1);
}
.code-output-head { color: var(--text-muted); font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.code-output-pre {
  color: #A9E24C; font-family: 'Fira Code', monospace; font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; direction: ltr; text-align: left;
  margin: 0; max-height: 300px; overflow-y: auto;
}

@media (max-width: 620px) {
  .code-editor-host .CodeMirror { height: 280px; }
}

/* ============ المساعد الذكي ============ */
.assistant-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 300; }

.assistant-bubble {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent-green-gradient); border: none; cursor: pointer;
  font-size: 26px; box-shadow: 0 10px 28px rgba(141,198,63,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.assistant-bubble:hover { transform: scale(1.08); }

.assistant-panel {
  position: absolute; bottom: 74px; left: 0;
  width: 340px; max-width: 88vw; height: 460px; max-height: 70vh;
  background: #fff; border-radius: var(--radius-md);
  box-shadow: 0 20px 56px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; overflow: hidden;
  text-align: right;
}

.assistant-panel-head {
  background: var(--bg-gradient); color: #fff;
  padding: 14px 18px; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.assistant-panel-head button {
  background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; opacity: 0.8;
}
.assistant-panel-head button:hover { opacity: 1; }

.assistant-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: #F6F8F7;
}

.assistant-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.assistant-msg-user {
  align-self: flex-start; background: var(--accent-green); color: #fff; border-bottom-left-radius: 4px;
}
.assistant-msg-bot {
  align-self: flex-end; background: #fff; color: #12151A; border: 1px solid #EFF2F2; border-bottom-right-radius: 4px;
}

.assistant-input-row {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid #EFF2F2; background: #fff;
}
.assistant-input-row input {
  flex: 1; border: 1px solid #EFF2F2; border-radius: 10px; padding: 10px 14px; font-size: 13.5px;
}
.assistant-input-row button {
  background: var(--accent-green); color: #fff; border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.assistant-input-row button:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 620px) {
  .assistant-wrap { bottom: 16px; left: 16px; }
  .assistant-panel { bottom: 70px; height: 62vh; }
}

/* ============ تحسينات التجاوب مع كل الشاشات (Responsive Enhancements) ============ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .wrap {
    padding: 0 16px;
  }
  .sec-head h2 {
    font-size: 24px;
  }
  .sec-head p {
    font-size: 14px;
  }
  .iq-layout {
    grid-template-columns: 1fr !important;
  }
  .dash-chart-grid {
    grid-template-columns: 1fr !important;
  }
  .payment-layout {
    grid-template-columns: 1fr !important;
  }
  .exam-layout {
    grid-template-columns: 1fr !important;
  }
  .exam-panel {
    padding: 20px 16px;
  }
  .iq-panel {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 24px;
    line-height: 1.35;
  }
  .hero p {
    font-size: 14px;
  }
  .stats-card {
    grid-template-columns: 1fr;
  }
}

