/* Moodle 4 (Boost) inspired course page for the AIvation Module 1 preview */
:root {
  --brand: #0b2554;
  --brand-2: #1e5aa8;
  --gold: #c9a227;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1d2125;
  --muted: #5a6470;
  --line: #dee2e6;
  --ok: #357a32;
  --ok-bg: #e9f5e7;
  --bad: #ca3120;
  --bad-bg: #fbeae8;
  --content: #399be2;     /* Moodle "content" activity colour */
  --assess: #eb66a2;      /* Moodle "assessment" activity colour */
  --radius: 0.5rem;
  --drawer: 285px;
  --nav: 60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Montserrat, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.navbar {
  position: fixed; inset: 0 0 auto 0; height: var(--nav); z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
}
.drawer-toggle {
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius);
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.drawer-toggle:hover { background: var(--bg); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 800; font-size: 17px; }
.brand:hover { text-decoration: none; }
.topnav a { color: var(--text); padding: 18px 10px; border-bottom: 3px solid transparent; font-weight: 600; }
.topnav a.active { border-bottom-color: var(--brand-2); }
.topnav a:hover { text-decoration: none; background: var(--bg); }
.org { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13px; }

/* layout */
.layout { padding-top: var(--nav); }
.drawer {
  position: fixed; top: var(--nav); bottom: 0; left: 0; width: var(--drawer); z-index: 10;
  background: #fff; border-right: 1px solid var(--line); overflow-y: auto;
  transition: transform .25s ease;
}
body.drawer-closed .drawer { transform: translateX(-100%); }
.main { margin-left: var(--drawer); padding: 28px 40px 60px; max-width: calc(var(--drawer) + 1100px); transition: margin .25s ease; outline: none; }
body.drawer-closed .main { margin-left: 0; margin-right: auto; margin-left: auto; }
.drawer-head { padding: 16px 18px 8px; font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.ci-section { padding: 6px 0; }
.ci-section > .ci-title { display: block; padding: 6px 18px; font-weight: 700; color: var(--text); }
.ci-item { display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 30px; color: var(--text); font-size: 14px; }
.ci-item:hover { background: var(--bg); text-decoration: none; }
.ci-item.current { background: #e7eef8; border-left: 4px solid var(--brand-2); padding-left: 26px; font-weight: 600; }
.ci-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #adb5bd; flex: none; }
.ci-dot.done { background: var(--ok); border-color: var(--ok); }

/* page parts */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; font-weight: 800; color: var(--text); }
h2 { font-size: 20px; margin: 0; font-weight: 700; }
.lead { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

.course-hero {
  display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; margin-bottom: 26px;
}
.course-hero img { width: 100%; height: 100%; object-fit: cover; object-position: left center; display: block; min-height: 220px; }
.course-hero .info { padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand-2); background: #e7eef8; padding: 3px 10px; border-radius: 20px; }
.progress { height: 8px; border-radius: 4px; background: #e9ecef; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.progress-label { font-size: 13px; color: var(--muted); }

.section { margin-bottom: 18px; }
.section-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.activity { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.activity:last-child { border-bottom: 0; }
.act-icon { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.act-icon.content { background: var(--content); }
.act-icon.assess { background: var(--assess); }
.act-main { flex: 1; min-width: 0; }
.act-type { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.act-name { font-weight: 700; font-size: 16px; color: var(--text); }
.act-name:hover { color: var(--brand-2); }
.act-meta { font-size: 13px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
  padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; color: var(--text);
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: #174a8c; }
.btn.done { background: var(--ok-bg); border-color: #b7dbb3; color: var(--ok); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* video page */
.player-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
video { width: 100%; display: block; border-radius: var(--radius); background: #000; aspect-ratio: 16/9; }
.chapters { max-height: 540px; overflow-y: auto; }
.chapters h3 { margin: 0; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
.chapter { display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px 16px; border: 0; background: none; font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.chapter:hover { background: var(--bg); }
.chapter.now { background: #e7eef8; font-weight: 700; }
.chapter time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; }
.chapter .q { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--assess); }
.below-video { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 26px; }
.note { font-size: 13px; color: var(--muted); }

/* quiz */
.que { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin-bottom: 18px; }
.que .qinfo { background: #f8f9fa; border-right: 1px solid var(--line); padding: 14px; font-size: 13px; color: var(--muted); border-radius: var(--radius) 0 0 var(--radius); }
.que .qinfo b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.que .qtext { padding: 18px 22px; }
.que .qtext p { margin: 0 0 14px; font-weight: 600; }
.answer label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: var(--radius); cursor: pointer; border: 1px solid transparent; }
.answer label:hover { background: var(--bg); }
.answer input { margin-top: 4px; accent-color: var(--brand-2); }
.answer label.correct { background: var(--ok-bg); border-color: #b7dbb3; }
.answer label.wrong { background: var(--bad-bg); border-color: #f1c0ba; }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.footer { margin-top: 40px; font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .main { margin-left: 0; padding: 20px 16px 50px; }
  body:not(.drawer-closed) .drawer { box-shadow: 4px 0 18px rgba(0,0,0,.15); }
  .course-hero { grid-template-columns: 1fr; }
  .player-wrap { grid-template-columns: 1fr; }
  .chapters { max-height: 320px; }
  .que { grid-template-columns: 1fr; }
  .que .qinfo { border-right: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
  .org, .topnav { display: none; }
}
