:root {
  --ink: #2b333f;
  --muted: #6b7482;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e4e7ec;
  --brand: #ff5722;
  --brand-dark: #e0431a;
  --teal: #30cfaa;
  --purple: #8d66bc;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(43, 51, 63, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.page { flex: 1; }

/* ---------- top bar ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #ff8a3d); color: #fff; font-weight: 800; font-size: 14px;
}
.brand-name { font-size: 18px; }
.brand-name b { color: var(--brand); }
.brand-light .brand-name { color: #fff; }
.brand-light .brand-name b { color: #ffb08f; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--ink); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--brand); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(120deg, #2b333f 0%, #3c4758 60%, #5b4a7a 100%);
  color: #fff; padding: 56px 0 46px;
}
.hero h1 { font-size: clamp(26px, 4vw, 40px); }
.hero p { color: #d6dbe5; font-size: 17px; max-width: 640px; }
.hero .btn { margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
.stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 14px; }
.stat strong { display: block; font-size: 22px; color: #ffb08f; }
.stat span { font-size: 13px; color: #d6dbe5; }

/* ---------- buttons / chips / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 18px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #fff; color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.search {
  width: 100%; max-width: 360px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); font-size: 15px; background: #fff; color: var(--ink);
}
.search:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- sections ---------- */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-size: 24px; margin: 0; }

/* ---------- course grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; color: var(--ink); display: flex; flex-direction: column;
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-2px); text-decoration: none; color: var(--ink); }
.thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #ffd9c9, #d9ccec); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.broken img { display: none; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 16px; margin: 0; }
.price-row { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 16px; }
.mrp { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.free { background: #dff8f1; color: #14806a; }
.badge.paid { background: #fff0ea; color: var(--brand-dark); }
.badge.off { background: #eef0f4; color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- course page ---------- */
.crumbs { font-size: 14px; color: var(--muted); margin: 18px 0 6px; }
.crumbs a { color: var(--muted); }
.course-head { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.course-head .thumb { border-radius: var(--radius); box-shadow: var(--shadow); }
.course-head h1 { font-size: 28px; }
.course-info { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.course-info .desc { margin-top: 14px; font-size: 15px; color: #3b4453; }
.course-info .desc img { max-width: 100%; height: auto !important; border-radius: 10px; margin: 6px 0; }
.course-info .desc p { margin: 0 0 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.notice {
  background: #fff7e6; border: 1px solid #ffd58a; color: #7a5200;
  border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 14px 0;
}
.notice.err { background: #fff0f0; border-color: #ffb3b3; color: #8a1f1f; }

/* ---------- tree / lecture rows ---------- */
.tree { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--ink);
}
.row:hover { border-color: #ffb8a3; text-decoration: none; color: var(--ink); }
.row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-icon {
  flex: 0 0 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: #fff0ea; color: var(--brand-dark); font-weight: 800; font-size: 13px;
}
.row-icon.folder { background: #efeafa; color: var(--purple); }
.row-icon.pdf { background: #e7f9f4; color: #14806a; }
.row-title { font-weight: 700; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; color: var(--muted); }
.row-end { flex: 0 0 auto; font-size: 14px; color: var(--brand-dark); font-weight: 700; white-space: nowrap; }
.row.disabled { opacity: .6; }

/* ---------- watch page ---------- */
.player-wrap { margin-top: 14px; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; position: relative; }
.player-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.player-msg {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  color: #fff; text-align: center; font-size: 15px; background: #111;
}
.watch-title { font-size: 22px; margin: 14px 0 6px; }

/* ---------- support / misc ---------- */
.support-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); max-width: 640px; }
.loading-screen { display: grid; place-items: center; min-height: 50vh; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%; border: 4px solid #ffd9c9;
  border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { color: var(--muted); padding: 24px 0; }

/* ---------- footer ---------- */
.footer { background: #2b333f; color: #d6dbe5; padding: 30px 0 0; margin-top: 30px; }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer .muted { color: #aab2bf; }
.footer a { color: #ffb08f; }
.contact div { margin-bottom: 4px; font-size: 15px; }
.copy { text-align: center; font-size: 13px; color: #aab2bf; border-top: 1px solid rgba(255,255,255,.1); margin-top: 22px; padding: 14px 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .course-head { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav { gap: 12px; }
  .nav a { font-size: 14px; }
  .brand-name { font-size: 16px; }
  .hero { padding: 40px 0 34px; }
  .row { padding: 12px; }
  .row-end { font-size: 13px; }
}
