/* Dao tao mo – trang nguoi hoc */
.dtm { max-width: 1180px; margin: 0 auto; padding: 16px; }
.dtm h1, .dtm h2, .dtm h3 { color: var(--navy); }
.tabs2 { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin: 6px 0 14px; flex-wrap: wrap; }
.tabs2 button { background: none; border: 0; padding: 9px 14px; font: inherit; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; }
.tabs2 button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
/* Trang khoa hoc */
.ch { display: grid; grid-template-columns: 1fr; gap: 14px; }
.ch-top { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.ch-top .cv { width: 340px; max-width: 100%; aspect-ratio: 16/7; border-radius: 14px; background: linear-gradient(135deg, #1C75BC, #7c3aed); background-size: cover; background-position: center; }
.player { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; }
.player iframe, .player video, .player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cert2 { display: flex; gap: 14px; align-items: center; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 14px; padding: 14px; }
.cert2 .ic { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #16a34a; color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; }
/* Ho tro hoc tap: han hoan thanh, luyen tap chuong, hoi dap theo bai, tro ly AI, khao sat */
.duebar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 12px; font-size: .9rem; }
.qa2 .qi { border-top: 1px solid var(--border); padding: 10px 0; }
.qa2 .qi:first-of-type { border-top: 0; }
.qa2 .ans { background: var(--bg); border-left: 3px solid var(--brand); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.pr2.ok { border-color: #86efac; background: #f0fdf4; }
.pr2.no { border-color: #fca5a5; background: #fef2f2; }
.aifab { position: fixed; right: 18px; bottom: 18px; z-index: 40; border-radius: 999px; box-shadow: 0 6px 20px rgba(16, 24, 40, .22); padding: 12px 18px; }
.aipanel { position: fixed; right: 18px; bottom: 78px; z-index: 41; width: min(420px, calc(100vw - 32px)); height: min(580px, calc(100vh - 110px)); display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(16, 24, 40, .25); }
.aipanel .hd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.aipanel .hd b { flex: 1; color: var(--navy); }
.aipanel .msgs { flex: 1; overflow: auto; padding: 12px; }
.aipanel .bb { margin: 6px 0; padding: 8px 11px; border-radius: 12px; max-width: 92%; font-size: .92rem; }
.aipanel .bb.u { background: var(--brand); color: #fff; margin-left: auto; white-space: pre-wrap; }
.aipanel .bb.a { background: var(--bg); }
.aipanel .bb.a small { display: block; color: var(--muted); margin-top: 4px; }
.aipanel .ft { border-top: 1px solid var(--border); padding: 8px; display: flex; gap: 6px; align-items: flex-end; }
.aipanel textarea { flex: 1; resize: none; margin: 0; min-height: 40px; max-height: 120px; }
.rate2 { display: flex; gap: 6px; flex-wrap: wrap; }
.rate2 label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; padding: 0 10px; }
.rate2 input { position: absolute; opacity: 0; pointer-events: none; }
.rate2 label.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.rate2 label:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.nb2 { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.nb2:first-of-type { border-top: 0; }
.nb2.unread b { color: var(--brand); }
@media (max-width: 640px) { .aifab { right: 12px; bottom: 12px; } .aipanel { right: 8px; left: 8px; width: auto; bottom: 70px; } }
/* Cau hoi trong video */
.player > .vq2 { z-index: 3; display: grid; place-items: center; background: rgba(15, 23, 42, .86); overflow: auto; padding: 12px; }
.vq2-box { background: #fff; color: var(--text, #1f2937); border-radius: 12px; padding: 14px 16px; width: min(560px, 100%); max-height: 100%; overflow: auto; }
.vq2-box .opt2 { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; background: #fff; }
.vq2-box .opt2.no { border-color: #fca5a5; background: #fef2f2; }
.vq2-box .opt2.on { border-color: #86efac; background: #f0fdf4; }
/* Kiem soat viec doc */
.rdwrap { position: relative; height: min(78vh, 900px); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #e9edf3; }
.rdwrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.rdov { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(15, 23, 42, .86); padding: 12px; overflow: auto; }
.rdov .opt2 { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; background: #fff; }
.rdbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: .9rem; }
.rdbar .ok { color: #15803d; }
.rdbar .ok::before { content: '✓ '; }
.opt2.no { border-color: #fca5a5; background: #fef2f2; }
/* Bao ve bai doc (kiem soat viec doc) */
.prot { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overflow: hidden; }
.prot canvas, .prot img { pointer-events: none; -webkit-user-drag: none; }
.wm2 { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: .1; z-index: 2; }
.wm2 div { position: absolute; white-space: nowrap; transform: rotate(-28deg); font-weight: 600; font-size: 14px; color: #0f172a; }
@media print { .prot { display: none !important; } }
/* Phu de tren video + ban chep loi */
.player > .capwrap { display: flex; align-items: flex-end; justify-content: center; pointer-events: none; z-index: 2; padding: 0 4% 9%; background: none; }
.capwrap span { background: rgba(0, 0, 0, .78); color: #fff; padding: 4px 12px; border-radius: 6px; font-size: clamp(14px, 2.1vw, 21px); line-height: 1.35; max-width: 92%; text-align: center; }
.tr2 { margin-top: 8px; }
.tr2 summary { cursor: pointer; font-weight: 600; }
.trlist { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.trlist button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 5px 8px; font: inherit; font-size: .9rem; cursor: pointer; color: inherit; }
.trlist button:hover { background: var(--bg); }
.trlist button.on { background: var(--cite-bg); }
.trlist small { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
/* Bai giang thuyet minh */
.sld { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #1C75BC, #1C5FA8); color: #fff; }
.sld-in { position: relative; height: 100%; padding: 5% 7%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
.sld-in h2 { color: #fff; margin: 0 0 4%; font-size: clamp(18px, 3.4vw, 34px); line-height: 1.25; }
.sld-in ul { margin: 0; padding-left: 1.2em; font-size: clamp(14px, 2.2vw, 22px); line-height: 1.55; }
.sld-n { position: absolute; right: 3%; bottom: 3%; font-size: .85rem; opacity: .8; }
/* Trinh phat bai giang thuyet minh (slide that) */
.sldwrap { position: relative; background: #0f172a; border-radius: 12px; overflow: hidden; outline: none; }
.sldwrap:focus-visible { box-shadow: 0 0 0 3px var(--brand); }
.sldbox { background: #fff; min-height: 120px; }
.sldwrap:fullscreen { display: flex; flex-direction: column; justify-content: center; border-radius: 0; }
.sldwrap:fullscreen .sldbox { width: min(100vw, calc((100vh - 56px) * 16 / 9)); margin: 0 auto; }
.scap { position: absolute; left: 50%; transform: translateX(-50%); bottom: 64px; max-width: 90%; background: rgba(0, 0, 0, .78); color: #fff; padding: 5px 12px; border-radius: 6px; font-size: clamp(14px, 2vw, 20px); line-height: 1.35; text-align: center; pointer-events: none; z-index: 2; }
.sbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 10px; background: #0f172a; color: #e2e8f0; }
.sbar .hint, .sbar label { color: #cbd5e1; }
.sbar .btn.ghost { color: #e2e8f0; }
/* Cau hoi trong slide: phu len khung slide (ca khi toan man hinh) */
.sqov { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(15, 23, 42, .86); padding: 12px; overflow: auto; }
.sqov .vq2-box { width: min(620px, 100%); }
.sqopt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 9px; margin: 6px 0; cursor: pointer; }
.sqopt input { width: auto; margin: 3px 0 0; flex: none; }
.sqopt:hover { background: #f8fafc; }
.sqopt.ok { border-color: #86efac; background: #f0fdf4; }
.sqopt.no { border-color: #fca5a5; background: #fef2f2; }
.sthumbs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px; background: #1e293b; }
.sthumbs button { flex: none; width: 150px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: #fff; cursor: pointer; overflow: hidden; text-align: center; font: inherit; }
.sthumbs button.on { border-color: #FFA827; }
.sthumbs .tb-in { pointer-events: none; min-height: 40px; }
.sthumbs small { display: block; background: #334155; color: #fff; font-size: .75rem; }
