/* I Will Pass NCLEX — Phase 2 styles (loaded after app.css) */

/* ---------- Next Generation question types ---------- */
.ngn-matrix { background: #fff; margin-bottom: 0; }
.ngn-matrix thead th { background: #F1F6F8; font-size: 0.9rem; vertical-align: bottom; }
.ngn-matrix th[scope="row"], .ngn-matrix tbody th { font-family: var(--font-read); font-size: 1.02rem; min-width: 190px; }
.ngn-matrix td { padding: 0; }
.ngn-matrix td.text-center > i { font-size: 1.15rem; }
.ngn-cell { display: grid; place-items: center; min-height: 52px; min-width: 64px; cursor: pointer; margin: 0; }
.ngn-cell input { width: 1.5rem; height: 1.5rem; accent-color: var(--teal); cursor: pointer; }
.ngn-cell:has(input:checked) { background: #EEF8F9; }
.ngn-cell:has(input:focus-visible) { outline: 3px solid var(--marker); outline-offset: -3px; }
.ngn-matrix td.ngn-ok, span.ngn-ok { background: var(--ok-soft); color: var(--ok); }
.ngn-matrix td.ngn-bad { background: var(--bad-soft); color: var(--bad); }
.ngn-matrix td.ngn-picked { background: #EEF8F9; color: var(--teal); }
.ngn-matrix td.ngn-ok, .ngn-matrix td.ngn-bad, .ngn-matrix td.ngn-picked { padding: 0.6rem; }
span.ngn-ok { border-radius: 4px; }

.ngn-bowtie button.q-option { width: 100%; font: inherit; color: inherit; }
.ngn-bowtie .q-option.is-picked { border-color: var(--teal); background: #EEF8F9; box-shadow: inset 5px 0 0 var(--teal); }
.ngn-bowtie .q-option:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }
.ngn-bowtie .col-md-4:nth-child(2) .q-option { justify-content: center; text-align: center; }
.q-option.is-missed { border-style: dashed; border-color: var(--ok); background: #fff; }

.ngn-pool { border: 2px dashed #A9BBC6; border-radius: 12px; padding: 0.85rem; background: #fff; }
.ngn-pool.is-over, .ngn-bucket.is-over { border-color: var(--teal); background: #EEF8F9; }
.ngn-bucket { border: 2px solid var(--line); border-radius: 12px; padding: 0.75rem; background: #F9FBFC; min-height: 130px; height: 100%; }
.ngn-dd.has-selection .ngn-bucket { border-color: var(--teal); cursor: pointer; }
.ngn-bucket-head { display: block; width: 100%; text-align: left; font-weight: 700; background: none; border: 0; padding: 0 0 0.5rem; color: var(--ink); }
.ngn-dd.has-selection .ngn-bucket-head::after { content: " +"; color: var(--teal); }
.ngn-chip { border: 2px solid #8FA3AF; background: #fff; color: var(--ink); border-radius: 10px; padding: 0.5rem 0.8rem; font-size: 0.98rem; text-align: left; min-height: 44px; cursor: grab; }
.ngn-chip:hover { border-color: var(--teal); }
.ngn-chip.is-selected { background: var(--marker-soft); border-color: #C89B00; box-shadow: 0 0 0 3px var(--marker); }

.ngn-passage { font-family: var(--font-read); font-size: 1.12rem; line-height: 2.05; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.15rem; }
.ngn-preview { background: #F9FBFC; min-height: 3.4rem; white-space: pre-wrap; }
.hl { border-radius: 5px; padding: 0.12rem 0.3rem; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hl-btn { font: inherit; color: inherit; border: 0; background: #EEF3F6; border-bottom: 2px dotted #6D8494; cursor: pointer; text-align: left; display: inline; }
.hl-btn:hover { background: var(--marker-soft); }
.hl-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.hl-picked { background: var(--marker); border-bottom-color: transparent; }
.hl-ok { background: var(--ok-soft); color: #0E5E3E; font-weight: 600; }
.hl-bad { background: var(--bad-soft); color: #8E2323; }
.hl-missed { background: #fff; outline: 2px dashed var(--ok); outline-offset: -2px; color: #0E5E3E; }
.hl-plain { background: #EEF3F6; }
.ngn-blanks .ngn-select, .ngn-preview .ngn-select { display: inline-block; width: auto; max-width: 100%; min-width: 9rem; font-family: var(--font-ui); margin: 0.15rem 0.2rem; vertical-align: baseline; border-width: 2px; }
.ngn-blanks .ngn-input { display: inline-block; width: 8.5rem; max-width: 100%; font-family: var(--font-ui); margin: 0.15rem 0.2rem; vertical-align: baseline; border-width: 2px; text-align: center; }

.ngn-order { margin: 0; padding: 0; list-style: none; counter-reset: ord; display: grid; gap: 0.5rem; }
.ngn-order li { counter-increment: ord; display: flex; align-items: center; gap: 0.5rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 0.6rem 0.75rem; min-height: 54px; }
.ngn-order li::before { content: counter(ord); flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }
.ngn-order.is-live li { cursor: grab; }
.ngn-order li.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.ngn-order li.is-correct::before { background: var(--ok); }
.ngn-order li.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.ngn-order li.is-wrong::before { background: var(--bad); }

/* ---------- case studies: the client chart ---------- */
.case-chart { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.case-chart-head { background: var(--ink); color: #fff; padding: 0.85rem 1.1rem; }
.case-chart-head .small { color: #C9D6E8; }
.case-tabs { display: flex; gap: 0.25rem; overflow-x: auto; padding: 0.5rem 0.6rem 0; border-bottom: 1px solid var(--line); background: #F1F6F8; scrollbar-width: thin; }
.case-tab { flex: none; border: 1px solid transparent; border-bottom: 0; background: none; padding: 0.5rem 0.75rem; font-weight: 600; font-size: 0.9rem; color: var(--muted); border-radius: 8px 8px 0 0; min-height: 44px; }
.case-tab.active { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: inset 0 3px 0 var(--marker); }
.case-panel { padding: 1rem 1.1rem; font-family: var(--font-read); font-size: 1.05rem; line-height: 1.6; }
.case-layout .case-chart { display: none; }
.case-layout.chart-open .case-chart { display: block; margin-bottom: 1rem; }
@media (min-width: 992px) {
  .case-layout { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 1.25rem; align-items: start; }
  .case-layout .case-chart { display: block; }
  .case-layout .case-side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
}
details.panel > summary { cursor: pointer; }
.case-layout.no-chart { display: block; }
.case-layout.no-chart .case-side { display: none; }

/* ---------- exams, adaptive simulation, readiness ---------- */
.exam-timer { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--ink); color: #fff; border-radius: 99px; padding: 0.45rem 1rem; margin-bottom: 0.9rem; font-weight: 600; position: sticky; top: 0.5rem; z-index: 6; }
.exam-timer strong { font-variant-numeric: tabular-nums; font-size: 1.1rem; min-width: 3.4rem; text-align: right; }
.exam-timer.is-low { background: var(--marker); color: var(--ink); }
.cat-result { border-radius: 12px; padding: 1rem 1.15rem; border-left: 8px solid var(--teal); background: #F1F8F9; }
.cat-result.is-above { border-color: var(--ok); background: var(--ok-soft); }
.cat-result.is-near { border-color: #C89B00; background: var(--marker-soft); }
.cat-result.is-below { border-color: var(--bad); background: var(--bad-soft); }
.disclaimer { font-size: 0.9rem; color: var(--muted); background: #F1F6F8; border-radius: 10px; padding: 0.65rem 0.85rem; }
.chart { width: 100%; height: auto; display: block; font-family: var(--font-ui); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.875rem; margin-top: 0.4rem; }
.chart-legend i { display: inline-block; width: 0.9rem; height: 0.25rem; border-radius: 2px; margin-right: 0.4rem; vertical-align: middle; }
.hbars { display: grid; gap: 0.7rem; }
.hbar .progress { margin-top: 0.2rem; }
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.rec-list li { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; align-items: start; }
.rec-list li > i { font-size: 1.3rem; color: var(--teal); line-height: 1.2; }
.rec-list li > form, .rec-list li > a { grid-column: 2; justify-self: start; }
@media (min-width: 768px) { .rec-list li { grid-template-columns: auto 1fr auto; align-items: center; } .rec-list li > form, .rec-list li > a { grid-column: 3; } }
.readiness-num { font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; letter-spacing: -0.03em; }
.readiness-num span { font-size: 1.4rem; }

/* ---------- AI tutor / coach chat ---------- */
.chat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem; }
.chat-log { display: grid; gap: 0.9rem; max-height: 62vh; min-height: 220px; overflow-y: auto; padding: 0.25rem 0.25rem 0.9rem; align-content: start; }
.chat-empty { text-align: center; padding: 1.5rem 0.5rem; color: var(--ink); }
.chat-empty > i { font-size: 2rem; color: var(--teal); }
.chat-empty .q-tool { text-align: left; border-radius: 12px; }
.chat-msg { display: grid; gap: 0.15rem; max-width: 92%; }
.chat-msg.is-user { justify-self: end; }
.chat-who { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.chat-msg.is-user .chat-who { text-align: right; }
.chat-bubble { border-radius: 14px; padding: 0.7rem 0.95rem; background: #F1F6F8; font-family: var(--font-read); font-size: 1.05rem; line-height: 1.55; overflow-wrap: anywhere; }
.chat-msg.is-user .chat-bubble { background: var(--ink); color: #fff; font-family: var(--font-ui); font-size: 1rem; border-bottom-right-radius: 4px; }
.chat-msg.is-ai .chat-bubble { border-bottom-left-radius: 4px; }
.chat-bubble p { margin: 0 0 0.6rem; }
.chat-bubble ul, .chat-bubble ol { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.chat-bubble > :last-child { margin-bottom: 0; }
.chat-bubble.is-waiting { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 0.5rem; align-items: flex-end; border-top: 1px solid #E7EEF2; padding-top: 0.8rem; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 52px; }
.chat-form .btn { min-height: 52px; white-space: nowrap; }
.chat-context { border-left: 5px solid var(--marker); }
.module-access { background: #F9FBFC; border: 1px solid #E7EEF2; border-radius: 10px; padding: 0.7rem 0.85rem; }

/* ---------- pharmacology, lab values, calculators ---------- */
.ref-card { display: block; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; color: inherit; text-decoration: none; }
.ref-card:hover { border-color: var(--teal); color: inherit; }
.ref-card h3 { font-size: 1.15rem; margin: 0.15rem 0 0; }
.ref-card p { font-size: 0.95rem; color: var(--muted); }
.ref-section .panel-title i { color: var(--teal); margin-right: 0.3rem; }
.ref-text { font-family: var(--font-read); font-size: 1.05rem; line-height: 1.6; }
.boxed-warning { border: 3px solid var(--ink); border-radius: 10px; padding: 0.85rem 1rem; background: #fff; }
.boxed-warning strong { display: block; margin-bottom: 0.25rem; }
.lab-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lab-row { border-bottom: 1px solid #E7EEF2; }
.lab-row:last-child { border-bottom: 0; }
.lab-row > summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.85rem 1.1rem; cursor: pointer; min-height: 52px; align-items: center; list-style-position: outside; }
.lab-row > summary:hover { background: var(--paper); }
.lab-row[open] > summary { background: var(--marker-soft); }
.lab-name { font-weight: 700; }
.lab-range { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--teal-dark); }
.lab-body { padding: 0.9rem 1.1rem 1.1rem; font-family: var(--font-read); font-size: 1.03rem; }
.lab-body h3 { font-family: var(--font-ui); }
.lab-hl { border-radius: 10px; padding: 0.7rem 0.85rem; height: 100%; }
.lab-hl .fw-bold { font-family: var(--font-ui); }
.lab-hl.is-high { background: var(--bad-soft); }
.lab-hl.is-low { background: var(--mist); }
.calc-nav { display: grid; gap: 0.4rem; }
.calc-nav a { display: block; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 0.6rem 0.85rem; color: inherit; text-decoration: none; }
.calc-nav a span { display: block; font-size: 0.875rem; color: var(--muted); }
.calc-nav a:hover { border-color: #9DB6C1; }
.calc-nav a.active { border-color: var(--ink); box-shadow: inset 5px 0 0 var(--marker); }
@media (max-width: 991.98px) { .calc-nav { grid-auto-flow: column; grid-auto-columns: minmax(200px, 70%); overflow-x: auto; padding-bottom: 0.4rem; } .calc-nav a span { display: none; } }
.calc-formula { background: #F1F6F8; border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; font-weight: 600; }
.calc-result { border-left: 8px solid var(--teal); background: #F1F8F9; border-radius: 12px; padding: 0.85rem 1.1rem; }
.calc-result.is-warn { border-color: var(--bad); background: var(--bad-soft); }
.calc-value { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.15; letter-spacing: -0.02em; }
.calc-steps { font-family: var(--font-read); font-size: 1.08rem; display: grid; gap: 0.3rem; padding-left: 1.4rem; margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- flashcards ---------- */
.flash-card { background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 1.4rem 1.25rem; min-height: 260px; display: grid; align-content: center; gap: 0.8rem; cursor: pointer; box-shadow: 6px 6px 0 var(--marker); margin: 0.25rem 6px 1rem 0; }
.flash-card.is-flipped { cursor: default; align-content: start; }
.flash-side { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.flash-front { font-family: var(--font-read); font-size: 1.45rem; line-height: 1.4; white-space: pre-line; outline: 0; }
.flash-back { border-top: 2px dashed var(--line); padding-top: 0.9rem; }
.flash-back-text { font-family: var(--font-read); font-size: 1.2rem; line-height: 1.5; white-space: pre-line; }
.flash-actions { flex-wrap: wrap; }
.flash-actions > .btn-ink { flex: 1; }
.flash-rate { flex: 1 1 22%; min-width: 0; display: grid; gap: 0.1rem; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 0.5rem 0.3rem; line-height: 1.2; }
.flash-rate span { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.flash-rate.is-again { border-color: var(--bad); }
.flash-rate.is-hard { border-color: #D9930A; }
.flash-rate.is-good { border-color: var(--teal); }
.flash-rate.is-easy { border-color: var(--ok); }
.flash-rate:hover, .flash-rate:focus-visible { background: var(--marker-soft); }
@media (max-width: 575.98px) { .flash-rate span { display: none; } }

/* ---------- video library, downloads ---------- */
.video-thumb { aspect-ratio: 16 / 9; background: var(--ink) center / cover no-repeat; display: grid; place-items: center; position: relative; border-radius: 13px 13px 0 0; }
.video-thumb > i { font-size: 3rem; color: #fff; opacity: 0.92; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); }
.video-time { position: absolute; right: 0.5rem; bottom: 0.5rem; background: rgba(20, 33, 61, 0.88); color: #fff; font-size: 0.78rem; font-weight: 600; border-radius: 6px; padding: 0.1rem 0.4rem; }
.res-row { display: flex; gap: 0.9rem; align-items: center; padding: 0.9rem 1.1rem; border-bottom: 1px solid #E7EEF2; flex-wrap: wrap; }
.res-row:last-child { border-bottom: 0; }
.res-icon { font-size: 1.7rem; color: var(--teal); }
.res-row > .flex-grow-1 { min-width: 200px; }

/* ---------- points, badges, streaks ---------- */
.game-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }
.game-item { display: flex; align-items: center; gap: 0.6rem; }
.game-item > i { font-size: 1.7rem; color: #B9C9D1; }
.game-item > i.is-on.bi-fire { color: #E0672B; }
.game-item > i.is-on { color: #C89B00; }
.game-item strong { display: block; font-size: 1.15rem; line-height: 1.1; }
.game-item span { font-size: 0.8125rem; color: var(--muted); }
.badge-chip { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--marker); color: var(--ink); font-weight: 700; border-radius: 99px; padding: 0.25rem 0.7rem; font-size: 0.875rem; }
.badge-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; height: 100%; display: grid; gap: 0.3rem; align-content: start; }
.badge-card > i { font-size: 2rem; color: #B9C9D1; line-height: 1; }
.badge-card h3 { font-size: 1rem; margin: 0.2rem 0 0; }
.badge-card p { font-size: 0.875rem; color: var(--muted); margin: 0 0 0.3rem; }
.badge-card.is-earned { border-color: #E0BE3C; background: linear-gradient(#fff, #fff) padding-box, var(--marker-soft); box-shadow: inset 0 5px 0 var(--marker); }
.badge-card.is-earned > i { color: #C89B00; }
.streak-cal { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; max-width: 420px; }
.streak-cal li { aspect-ratio: 1; border-radius: 8px; background: #EEF3F6; color: var(--muted); display: grid; place-items: center; font-size: 0.8rem; font-weight: 600; }
.streak-cal li.is-on { background: var(--teal); color: #fff; }
.streak-cal li.is-today { outline: 3px solid var(--marker); outline-offset: 1px; }

/* ---------- study plan ---------- */
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.plan-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 0.7rem; min-height: 52px; }
.plan-list li > i { font-size: 1.25rem; color: var(--teal); }
.plan-list li.is-done { background: var(--ok-soft); border-color: #B5DFC9; }
.plan-list li.is-done > span { text-decoration: line-through; text-decoration-color: #7FB79C; }
.plan-list li.is-done > i { color: var(--ok); }
@media (max-width: 575.98px) {
    .plan-list li { grid-template-columns: auto 1fr; }
    .plan-list li > a.btn, .plan-list li > .small.fw-semibold { grid-column: 2; justify-self: start; }
}
.plan-check { margin: 0; }
.plan-check button { border: 0; background: none; padding: 0.3rem; font-size: 1.5rem; line-height: 1; color: #8FA3AF; min-width: 44px; min-height: 44px; }
.plan-check button[aria-pressed="true"] { color: var(--ok); }
.plan-check button:hover { color: var(--teal); }

/* ---------- notifications ---------- */
.notif-row { display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.85rem 1.1rem; border-bottom: 1px solid #E7EEF2; color: inherit; text-decoration: none; }
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: var(--paper); color: inherit; }
.notif-row > i:first-child { font-size: 1.35rem; color: var(--teal); margin-top: 0.1rem; }
.notif-row.is-unread { background: var(--marker-soft); }
.notif-dot { position: absolute; top: 2px; right: 0; background: var(--bad); color: #fff; border-radius: 99px; font-size: 0.68rem; font-weight: 700; min-width: 1.1rem; height: 1.1rem; display: grid; place-items: center; padding: 0 0.25rem; }

/* ---------- languages (admin) ---------- */
.lang-row { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.lang-row:first-of-type { border-top: 0; }
.lang-source { background: #F6F9FA; border-radius: 8px; padding: 0.5rem 0.7rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- last 7 days strip (student dashboard) ---------- */
.week-wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; }
.week-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.5rem; }
.week-strip li { display: grid; justify-items: center; gap: 0.2rem; font-size: 0.8125rem; color: var(--muted); }
.week-dot { width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: #fff; }
.week-strip li.is-on .week-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.week-strip li.is-today .week-day { color: var(--ink); font-weight: 700; }
.week-strip li.is-today .week-dot { box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.18); }

/* ---------- top bar search + language choice ---------- */
.top-search { flex: 1 1 260px; max-width: 460px; margin: 0; }
.top-search .input-group-text { background: #fff; color: var(--muted); border-right: 0; }
.top-search .form-control { border-left: 0; padding-left: 0; }
.side-lang { display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; align-items: center; font-size: 0.875rem; }
.side-lang a { color: #C9D6E2; }
.side-lang strong { color: #fff; }
.search-group + .search-group { margin-top: 1.5rem; }
.search-hit { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.search-hit:first-of-type { border-top: 0; }
.search-hit:hover strong { text-decoration: underline; }
.search-hit > i { font-size: 1.2rem; color: var(--teal); margin-top: 0.1rem; }
.search-hit mark { background: #FFE9A8; padding: 0 0.1em; border-radius: 3px; }
