/* LearnWise · client brief 12 Nov 2026: paper start options, our video player, after-paper sections, long answers,
   Done / Flag, larger questions on phones, timed hints, posters, back button, Quick Revision, completion pop-up. */

/* ---------- Back button in the top bar ---------- */
.back-btn { flex: 0 0 auto; }
.portal-top .back-btn { margin-right: .25rem; }

/* ---------- Sample paper: start with / without OTP ---------- */
.start-options { display: grid; gap: .75rem; }
.start-option { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; padding: 1rem 1.1rem; border-radius: 16px; border: 1.5px solid var(--lw-line); background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.start-option:hover, .start-option:focus-visible { border-color: var(--lw-primary); box-shadow: 0 8px 24px rgba(244, 123, 32, .15); transform: translateY(-1px); }
.start-option .so-icon { flex: 0 0 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: #fff7ed; color: #ea580c; }
.start-option .so-icon.so-plain { background: #ecfdf5; color: #059669; }
.start-option .so-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.start-option .so-body b { font-size: 1.05rem; }
.start-option .so-body span { font-size: .85rem; color: #64748b; overflow-wrap: anywhere; }
.start-option > .bi-chevron-right { color: #94a3b8; }

/* ---------- Video player (our controls, YouTube's hidden) ---------- */
.lw-player { background: #000; border-radius: 14px; overflow: hidden; position: relative; }
.lwp-screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
.lwp-frame, .lwp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lwp-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.lwp-cover { position: absolute; inset: 0; z-index: 3; border: 0; padding: 0; background: #000; display: block; width: 100%; }
.lwp-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.lwp-cover .lwp-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; background: var(--lw-primary, #F47B20); color: #fff; display: grid; place-items: center; font-size: 2.4rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.lwp-cover .lwp-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem .9rem .7rem; color: #fff; font-weight: 700; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-size: .95rem; }
.lwp-cover:hover .lwp-big { transform: translate(-50%, -50%) scale(1.06); }
.lw-player.is-paused .lwp-shield { background: rgba(0, 0, 0, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72'%3E%3Ccircle cx='36' cy='36' r='36' fill='%23F47B20'/%3E%3Cpath d='M29 22l22 14-22 14z' fill='white'/%3E%3C/svg%3E") center / 64px no-repeat; }
.lw-player.is-ended .lwp-shield { background: rgba(0, 0, 0, .8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72'%3E%3Ccircle cx='36' cy='36' r='36' fill='%23F47B20'/%3E%3Cpath d='M29 22l22 14-22 14z' fill='white'/%3E%3C/svg%3E") center / 64px no-repeat; }
.lwp-loading { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; }
.lwp-loading[hidden] { display: none; }
.lwp-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; color: #fff; font-size: .9rem; }
.lwp-error a { color: #FFA94D; }
.lwp-bar { display: flex; align-items: center; gap: .35rem; padding: .45rem .6rem; background: #111827; color: #e5e7eb; }
.lwp-btn { position: relative; flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 1.25rem; display: grid; place-items: center; }
.lwp-btn small { position: absolute; font-size: .55rem; font-weight: 800; bottom: 6px; right: 6px; }
.lwp-btn:hover, .lwp-btn:focus-visible { background: rgba(255, 255, 255, .12); }
.lwp-play { background: var(--lw-primary, #F47B20); }
.lwp-play:hover { background: #ea6a0f; }
.lwp-time { font-size: .78rem; font-variant-numeric: tabular-nums; min-width: 2.6rem; text-align: center; color: #cbd5e1; }
.lwp-seek { flex: 1; min-width: 40px; accent-color: var(--lw-primary, #F47B20); height: 4px; }
.lw-player:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.lw-player:fullscreen .lwp-screen { flex: 1; aspect-ratio: auto; }
.lw-player.lwp-full { position: fixed; inset: 0; z-index: 2000; border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.lw-player.lwp-full .lwp-screen { flex: 1; aspect-ratio: auto; }
html.lwp-lock, html.lwp-lock body { overflow: hidden; }
/* Phones: the video uses the whole screen width */
@media (max-width: 575.98px) {
  .lw-player { width: 100vw; margin-left: calc(50% - 50vw); border-radius: 0; }
  .lwp-btn { width: 44px; height: 44px; }
  .lwp-time[data-lwp-dur] { display: none; }
}

/* ---------- After the paper: numbered items ---------- */
.after-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.after-item { display: flex; align-items: center; gap: .7rem; padding: .75rem .8rem; border-radius: 14px; border: 1.5px solid var(--lw-line); background: #fff; text-align: left; transition: all .15s; }
.after-item:hover { border-color: #fdba74; }
.after-item .ai-num { flex: 0 0 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-family: var(--lw-font-display); font-weight: 800; font-size: 1.1rem; background: #fff7ed; color: #ea580c; }
.after-item .ai-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.after-item .ai-body b { font-size: .9rem; }
.after-item .ai-body small { color: #64748b; font-size: .75rem; }
.after-item.active { border-color: var(--lw-primary); background: #fff7ed; box-shadow: 0 6px 18px rgba(244, 123, 32, .15); }
.after-item.active .ai-num { background: var(--lw-primary); color: #fff; }
@media (max-width: 575.98px) { .after-grid { grid-template-columns: 1fr 1fr; } }
.vid-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.vid-grid button.has-video { border-color: #fecaca; color: #b91c1c; background: #fff5f5; }
.vid-grid button:disabled { opacity: .4; cursor: not-allowed; }
.vid-grid button.vid-all { aspect-ratio: auto; grid-column: span 2; }
.vid-one, .wq-one { margin-top: .5rem; }
.q-image-wide { width: 100%; max-height: none; object-fit: contain; background: #fff; }

/* Long answers on the result page */
.wq-block { border: 1px solid var(--lw-line); border-radius: 14px; padding: .9rem 1rem; margin-bottom: .75rem; background: #fff; }
.wq-block.mine { background: #f8fafc; }
.wq-block.model { background: #f0fdf4; border-color: #bbf7d0; }
.wq-block.check { background: #fff7ed; border-color: #fed7aa; }
.wq-label { font-weight: 800; font-size: .85rem; margin-bottom: .5rem; }
.wq-text { white-space: normal; overflow-wrap: anywhere; margin-bottom: .5rem; }
.wq-point { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem .6rem; border-radius: 10px; background: #fff; border: 1px solid #fde4c8; margin-bottom: .4rem; cursor: pointer; font-size: .92rem; }
.wq-point .form-check-input { margin-top: .2rem; flex: 0 0 auto; }
.wq-point:has(input:checked) { border-color: #86efac; background: #f0fdf4; }

/* ---------- Exam: long answers, Done / Flag, flagged numbers, larger questions ---------- */
.long-answer { border: 1.5px dashed #cbd5e1; border-radius: 14px; padding: .8rem; background: #f8fafc; }
.la-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.la-timer { font-size: .8rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-variant-numeric: tabular-nums; }
.la-timer.over { background: #fef2f2; color: #b91c1c; }
.la-text { font-size: 1rem; user-select: text; -webkit-user-select: text; }
.la-photo { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
.la-photo-view { display: flex; align-items: center; gap: .3rem; }
.la-photo-view img { max-height: 90px; max-width: 160px; border-radius: 8px; border: 1px solid var(--lw-line); }
.q-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--lw-line); }
.q-actions .btn { flex: 1 1 140px; font-weight: 700; }
.exam-q.is-flagged { box-shadow: 0 0 0 2px #fcd34d; }
.exam-q.is-done .q-num::after { content: " ✓"; color: #16a34a; }
.palette a.flagged { background: var(--lw-warning-50, #fffbeb); border-color: #fcd34d; color: #92400e; }
.flag-strip { position: sticky; top: var(--exam-bar-h, 64px); z-index: 19; display: flex; align-items: center; gap: .5rem; padding: .45rem 1rem; background: #fffbeb; border-bottom: 1px solid #fde68a; overflow-x: auto; white-space: nowrap; }
.flag-strip[hidden] { display: none; }
.flag-strip .fs-label { font-size: .8rem; font-weight: 800; color: #92400e; flex: 0 0 auto; }
.flag-strip .fs-list { display: flex; gap: .35rem; }
.flag-strip a { min-width: 34px; height: 34px; padding: 0 .4rem; border-radius: 9px; display: grid; place-items: center; background: #fff; border: 1.5px solid #fcd34d; color: #92400e; font-weight: 800; text-decoration: none; }
.q-zoom { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; text-align: left; margin: 0 0 1.25rem; }
.q-zoom .q-image { margin: 0; }
.q-zoom .q-image-zoom { position: static; display: inline-flex; gap: .3rem; margin-top: .4rem; background: #f1f5f9; color: #475569; }
.exam-q .q-image { width: 100%; max-height: none; object-fit: contain; background: #fff; }
.zoom-view { position: fixed; inset: 0; z-index: 1100; background: rgba(15, 23, 42, .95); display: flex; flex-direction: column; }
.zoom-view[hidden] { display: none; }
.zoom-scroll { flex: 1; overflow: auto; touch-action: pan-x pan-y pinch-zoom; display: flex; align-items: center; }
.zoom-scroll img { display: block; width: 200%; max-width: none; background: #fff; margin: auto; }
@media (min-width: 768px) { .zoom-scroll img { width: auto; max-width: 95%; } }
.zoom-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; font-size: 1.2rem; }
.zoom-hint { color: #cbd5e1; text-align: center; font-size: .8rem; padding: .5rem; }
@media (max-width: 575.98px) {
  .exam-body { padding: .75rem .4rem; }
  .exam-q { padding: .9rem .75rem; }
  .exam-q .q-text { font-size: 1.1rem; }
  .exam-q .option { padding: .8rem .9rem; font-size: 1rem; }
  .exam-bar { padding: .6rem .75rem; gap: .5rem; }
}

/* ---------- Question Solving: timed hints, previous / next ---------- */
.hint-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.hint-slot { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .7rem .85rem; border-radius: 14px; border: 1.5px solid var(--lw-line); background: #f8fafc; color: #94a3b8; text-align: left; }
.hint-slot .hs-n { font-weight: 800; font-size: .95rem; }
.hint-slot .hs-t { font-size: .8rem; font-variant-numeric: tabular-nums; }
.hint-slot .hs-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #e2e8f0; }
.hint-slot .hs-bar span { display: block; height: 100%; width: 0; background: var(--lw-primary, #F47B20); transition: width 1s linear; }
.hint-slot.running { border-color: #fdba74; color: #9a3412; background: #fff7ed; }
.hint-slot.ready { border-color: var(--lw-primary, #F47B20); background: #fff; color: #9a3412; cursor: pointer; box-shadow: 0 6px 16px rgba(244, 123, 32, .18); }
.hint-slot.ready:hover { transform: translateY(-1px); }
.hint-slot.opened { border-color: #86efac; background: #f0fdf4; color: #166534; box-shadow: none; }
.q-prevnext { display: flex; gap: .5rem; margin-top: 1rem; }
.q-prevnext .btn { flex: 1; font-weight: 700; }
.q-prevnext .btn:nth-child(2) { flex: 0 0 auto; }

/* ---------- Doubt solving card, coming-soon chapters ---------- */
.doubt-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: 18px; background: linear-gradient(135deg, #eff6ff, #f5f3ff); border: 1px solid #c7d2fe; color: inherit; }
.doubt-card .dc-icon { flex: 0 0 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: #4f46e5; color: #fff; }
.doubt-card .dc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doubt-card .dc-body b { font-size: 1.05rem; color: #1e1b4b; }
.doubt-card .dc-body span { font-size: .85rem; color: #475569; }
@media (max-width: 575.98px) { .doubt-card { flex-wrap: wrap; } .doubt-card .btn { width: 100%; } }
.chapter-pick.is-coming { opacity: .75; cursor: default; filter: saturate(.75); }
.chapter-pick.is-coming .cp-meta { color: #b45309; font-weight: 600; }

/* ---------- Informative posters ---------- */
.info-posters { margin: 0 0 1.75rem; }
.ip-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .25rem .1rem .75rem; scrollbar-width: thin; }
@media (min-width: 1200px) { .ip-track { grid-auto-columns: calc((100% - 2 * .9rem) / 3); } }
.info-poster { scroll-snap-align: start; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .35rem; min-height: 190px; padding: 1.2rem 1.2rem 1rem; border-radius: 22px; color: #fff; text-decoration: none; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); transition: transform .15s; }
.info-poster:hover { transform: translateY(-2px); color: #fff; }
.info-poster::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.info-poster .ip-icon { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: .2rem; }
.info-poster .ip-title { font-family: var(--lw-font-display); font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
.info-poster .ip-text { font-size: .88rem; opacity: .95; flex: 1; }
.info-poster .ip-cta { font-weight: 800; font-size: .85rem; position: relative; z-index: 1; }
.p-orange { background: linear-gradient(135deg, #F47B20, #f59e0b); }
.p-blue { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.p-green { background: linear-gradient(135deg, #059669, #22c55e); }
.p-purple { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.p-rose { background: linear-gradient(135deg, #e11d48, #fb7185); }
.p-teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }

/* ---------- Quick Revision page ---------- */
.recap-card { min-height: 160px; }
.rq-q { font-family: var(--lw-font-display); font-weight: 800; font-size: 1.35rem; line-height: 1.35; overflow-wrap: anywhere; }
.rq-a { margin-top: .9rem; padding: .8rem 1rem; border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 1.05rem; overflow-wrap: anywhere; }
/* Multiple-choice options (Class 12 science MCQ banks) */
.rq-opts { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; gap: .45rem; }
.rq-opts li { padding: .55rem .85rem; border-radius: 10px; border: 1px solid #e5e7eb; background: #fff; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.rq-opts li.is-right { background: #f0fdf4; border-color: #22c55e; font-weight: 700; }
.rq-opts li.is-right .bi { color: #16a34a; }

/* ---------- Completion pop-up (one component everywhere) ---------- */
.celebrate-pop { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 1rem; background: rgba(15, 23, 42, .6); backdrop-filter: blur(4px); overflow: hidden; animation: cp-in .25s ease; }
.celebrate-pop.cp-out { opacity: 0; transition: opacity .25s; }
.cp-card { position: relative; z-index: 2; max-width: 400px; width: 100%; background: #fff; border-radius: 26px; padding: 1.8rem 1.5rem 1.2rem; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: cp-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.cp-burst { font-size: 3.5rem; line-height: 1; margin-bottom: .5rem; animation: cp-bounce 1s ease 2; }
.cp-card h2 { font-family: var(--lw-font-display); font-weight: 900; font-size: 1.5rem; margin-bottom: .4rem; }
.cp-text { color: #475569; margin-bottom: 1.1rem; }
.cp-actions { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.cp-actions .btn-primary { width: 100%; }
.cp-sound { color: #64748b; text-decoration: none; }
.cp-bit { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; z-index: 1; animation: cp-fall 2.6s linear forwards; }
@keyframes cp-in { from { opacity: 0; } }
@keyframes cp-pop { from { transform: scale(.6); opacity: 0; } }
@keyframes cp-bounce { 50% { transform: scale(1.18) rotate(-6deg); } }
@keyframes cp-fall { to { top: 105%; transform: translateX(40px) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .cp-card, .cp-burst, .celebrate-pop { animation: none; } }
.exam-mode .exam-q { scroll-margin-top: calc(var(--exam-bar-h, 64px) + 56px); }

/* Quick Revision: panda-led, one question at a time (13 Nov brief) */
.revise-stage { display: flex; gap: 1.5rem; align-items: center; min-height: 230px; }
.revise-panda { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; flex-shrink: 0; }
.revise-show { white-space: nowrap; }
.revise-main { flex: 1; min-width: 0; }
.revise-done { text-align: center; padding: 2rem 1.25rem; }
.revise-done:focus { outline: none; }
.revise-done .pet-mini { width: 110px; }
.revise-done h2 { font-family: var(--lw-font-display); font-weight: 900; font-size: 1.8rem; color: var(--lw-primary); margin-bottom: .5rem; }
.revise-done .rd-burst { font-size: 2.4rem; line-height: 1; margin-bottom: .4rem; }
@media (max-width: 575.98px) {
  .revise-stage { flex-direction: column; align-items: stretch; gap: 1rem; }
  .revise-panda .pet-btn { width: 140px; height: 140px; }
}
