/* Student pages: My Courses, course player, quizzes and results. Builds on lms-public.css. */

/* Signed-in navigation */
.nav-bell { position: relative; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; font-size: 1.15rem; color: var(--ink-soft); transition: background .2s; }
.nav-bell:hover { background: rgba(67, 94, 190, .1); color: var(--brand-deep); }
.nav-bell-count { position: absolute; top: -.1rem; right: -.2rem; min-width: 1.15rem; padding: 0 .3rem; border-radius: 99px; font-size: .68rem; font-weight: 800; line-height: 1.15rem; text-align: center; color: #fff; background: #d9465b; animation: pop .4s var(--ease) both; }
.nav-link-active { color: var(--brand-deep); background: rgba(67, 94, 190, .1); }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: .35rem; cursor: pointer; list-style: none; border-radius: 99px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .bi-chevron-down { font-size: .75rem; color: var(--muted); transition: transform .2s var(--ease); }
.user-menu[open] .bi-chevron-down { transform: rotate(180deg); }
.user-menu-panel { position: absolute; top: calc(100% + .6rem); right: 0; width: 240px; padding: .5rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: rise .2s var(--ease) both; }
.user-menu-head { padding: .5rem .7rem .65rem; margin-bottom: .35rem; border-bottom: 1px solid var(--line); }
.user-menu-head strong { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .7rem; border: 0; border-radius: 9px; font-weight: 600; font-size: .925rem; text-align: left; color: var(--ink-soft); background: transparent; }
.user-menu-item:hover { color: var(--brand-deep); background: rgba(67, 94, 190, .09); }

/* Page header band */
.student-band { position: relative; overflow: hidden; padding: 2.25rem 0 4.5rem; color: #d9ddf2; background: var(--ink); isolation: isolate; }
.student-band h1 { color: #fff; font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -.015em; margin: 0 0 .25rem; }
.student-band a { color: #fff; font-weight: 600; }
.student-body { margin-top: -3rem; padding-bottom: 3.5rem; position: relative; z-index: 2; }
.panel { padding: 1.5rem; margin-bottom: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.panel > h5 { font-weight: 800; }

/* Stat tiles */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-tile { display: flex; align-items: center; gap: .85rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.stat-tile i { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 12px; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, var(--brand), #7b6cf0); }
.stat-tile strong { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.stat-tile span { font-size: .82rem; color: var(--muted); }

/* Progress */
.progress-track { height: .55rem; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-fill { display: block; height: 100%; width: var(--value, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--brand), #17a589); animation: fillBar 1s var(--ease) both; transform-origin: left; }
.student-band .progress-track { background: rgba(255, 255, 255, .18); }
.student-band .progress-fill { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* Continue learning */
.resume-card { display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; margin-bottom: 2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.resume-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.resume-card .course-thumb { height: 100%; }
.resume-body { display: flex; flex-direction: column; justify-content: center; gap: .55rem; padding: 1.5rem 1.75rem; }
.resume-body small { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.resume-body h4 { font-weight: 800; margin: 0; }

.status-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .7rem; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.status-pill.is-pending { color: #7a4b00; background: #ffedc9; }
.status-pill.is-rejected { color: #8d1f30; background: #fbdde2; }
.status-pill.is-revoked { color: #33384f; background: #e3e5ee; }
.status-pill.is-done { color: #0c6652; background: #d0f4ea; }

/* Player */
.player-head { position: relative; overflow: hidden; padding: 1.15rem 0; color: #d9ddf2; background: var(--ink); isolation: isolate; }
.player-head h1 { margin: 0; font-size: 1.25rem; font-weight: 800; color: #fff; }
.player-head a { color: #aab0d0; font-size: .85rem; }
.player-head a:hover { color: #fff; }
.player-progress { flex: 0 1 280px; min-width: 200px; }
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; padding-block: 1.5rem 3.5rem; }
.player-stage { overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); animation: rise .45s var(--ease) both; }
.player-stage-body { padding: 1.5rem; }
.player-stage h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: 1rem; }
.player-stage .ratio { overflow: hidden; border-radius: 12px; }
.player-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: #fbfbfe; }
.player-side { position: sticky; top: 5.25rem; max-height: calc(100vh - 6.25rem); overflow-y: auto; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.player-side-title { padding: 1rem 1.15rem; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--line); }
.player-section { padding: .6rem 1.15rem; font-size: .8rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: #f7f8fc; }
.player-item { display: flex; align-items: center; gap: .65rem; padding: .7rem 1.15rem; border-top: 1px solid var(--line); font-size: .935rem; color: var(--ink-soft); transition: background .2s, padding-left .2s var(--ease); }
a.player-item:hover { padding-left: 1.4rem; color: var(--brand-deep); background: #f4f5fb; }
.player-item.is-active { font-weight: 700; color: var(--brand-deep); background: rgba(67, 94, 190, .1); box-shadow: inset 3px 0 0 var(--brand); }
.player-item.is-locked { color: #a0a6c0; }
.player-item .state { flex: none; font-size: 1.05rem; color: #b7bcd3; }
.player-item .state.is-done { color: #17a589; animation: pop .4s var(--ease) both; }
.player-item .title { flex: 1; min-width: 0; }
.mini-badge { flex: none; padding: .05rem .5rem; border-radius: 99px; font-size: .7rem; font-weight: 700; color: var(--brand-deep); background: rgba(67, 94, 190, .12); }
.mini-badge.is-required { color: #7a4b00; background: #ffedc9; }

.notice-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem; border-radius: 14px; animation: rise .45s var(--ease) both; }
.notice-card.is-success { position: relative; overflow: hidden; color: #0c6652; background: #d9f6ee; border: 1px solid #a9e8d7; }
.notice-card.is-success strong { color: #0a5243; }
.announcement { padding: .85rem 1.15rem; border-top: 1px solid var(--line); }
.announcement strong { color: var(--ink); }

.quiz-launch { padding: 2.5rem 1rem; text-align: center; border-radius: 14px; background: linear-gradient(135deg, #eef0fd, #f5eefd); }
.quiz-launch i { display: inline-grid; place-items: center; width: 4rem; height: 4rem; margin-bottom: .9rem; border-radius: 50%; font-size: 1.9rem; color: #fff; background: linear-gradient(135deg, var(--brand), #7b6cf0); }

/* Quiz */
.quiz-bar { position: sticky; top: 4.1rem; z-index: 20; padding: .75rem 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.quiz-bar h1 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.quiz-timer { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border-radius: 99px; font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); background: #eef0fa; }
.quiz-timer.is-low { color: #fff; background: #d9465b; animation: pulse 1s ease-in-out infinite; }
.question-card { padding: 1.5rem; margin-bottom: 1.1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .25s; }
.question-card.is-answered { border-color: rgba(67, 94, 190, .45); }
.question-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.question-head h6 { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
.points-badge { flex: none; align-self: flex-start; padding: .12rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 700; color: var(--muted); background: #eef0fa; }
.option-tile { display: flex; align-items: center; gap: .7rem; margin: 0 0 .5rem; padding: .7rem .95rem; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; color: var(--ink-soft); transition: border-color .2s, background .2s, transform .2s var(--ease); }
.option-tile:hover { border-color: rgba(67, 94, 190, .55); transform: translateX(3px); }
.option-tile .form-check-input { flex: none; margin: 0; }
.option-tile:has(input:checked) { border-color: var(--brand); background: rgba(67, 94, 190, .08); font-weight: 600; }

/* Results */
.score-ring { position: relative; flex: none; width: 140px; height: 140px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 11; }
.score-ring .track { stroke: rgba(255, 255, 255, .16); }
.score-ring .value { stroke: var(--accent-2); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: var(--offset); animation: ring 1.2s var(--ease) both; }
.score-ring.is-fail .value { stroke: var(--accent); }
.score-ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.65rem; font-weight: 800; color: #fff; }
.review-option { display: flex; align-items: flex-start; gap: .55rem; padding: .5rem .8rem; margin-bottom: .35rem; border-radius: 10px; }
.review-option.is-correct { font-weight: 600; color: #0c6652; background: #dcf6ee; }
.review-option.is-wrong { color: #8d1f30; background: #fbe4e8; }
.written-answer { padding: .8rem 1rem; margin-bottom: .6rem; border-radius: 12px; white-space: pre-line; color: var(--ink-soft); background: #f4f5fb; }

/* Celebration */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti span { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; animation: fall 2.6s ease-in forwards; }

@keyframes fillBar { from { width: 0; } }
@keyframes ring { from { stroke-dashoffset: 326.7; } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes fall { to { transform: translateY(420px) rotate(540deg); opacity: 0; } }

@media (max-width: 991.98px) {
    .player-layout { grid-template-columns: minmax(0, 1fr); }
    .player-side { position: static; max-height: none; }
}

@media (max-width: 767.98px) {
    .resume-card { grid-template-columns: minmax(0, 1fr); }
    .resume-card .course-thumb { height: auto; }
    .player-progress { flex-basis: 100%; }
    .player-stage-body, .panel, .question-card { padding: 1.1rem; }
    .nav-link-wide { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .confetti { display: none; }
    .score-ring .value, .progress-fill { animation: none !important; }
}

/* Existing pages shown inside the student layout. */
.lms-public .student-page { max-width: 1140px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 1.5rem) 3.5rem; }
