/* Leerpad LMS frontend styles */
:root {
	--lp-accent: #2d3e50;
	--lp-accent-2: #5b3f8f;
	--lp-ok: #2e9c6a;
	--lp-bg: #f4f6f8;
	--lp-border: #e2e6ea;
	--lp-text: #2b2f36;
}

.lp-wrap { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; color: var(--lp-text); }
.lp-course-title { font-size: 2.2rem; margin: 0 0 1.2rem; }
.lp-muted { color: #7a828c; }

/* Status bar (Current status / Price / Get started) */
.lp-status-bar { display: flex; flex-wrap: wrap; background: var(--lp-bg); border: 1px solid var(--lp-border); border-radius: 6px; margin-bottom: 1.5rem; }
.lp-status-cell { flex: 1 1 200px; padding: 1rem 1.2rem; text-align: center; border-right: 1px solid var(--lp-border); display: flex; flex-direction: column; gap: .45rem; align-items: center; justify-content: center; }
.lp-status-cell:last-child { border-right: 0; }
.lp-cell-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6a7280; }
.lp-price { font-size: 1.6rem; font-weight: 700; }
.lp-badge { display: inline-block; background: #3b4453; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .35em .9em; border-radius: 3px; }
.lp-badge-done { background: var(--lp-ok); }
.lp-badge-enrolled { background: var(--lp-accent-2); }

/* Buttons */
.lp-btn { display: inline-block; background: #e8eaee; color: var(--lp-text); border: 0; border-radius: 4px; padding: .55em 1.2em; font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.4; }
.lp-btn:hover { filter: brightness(.96); }
.lp-btn-primary { background: var(--lp-accent); color: #fff; }
.lp-btn-sm { padding: .3em .8em; font-size: .8rem; }

/* Progress */
.lp-progress { margin: 0 0 1.5rem; }
.lp-progress-track { background: var(--lp-border); border-radius: 99px; height: 10px; overflow: hidden; }
.lp-progress-fill { background: linear-gradient(90deg, var(--lp-accent), var(--lp-accent-2)); height: 100%; transition: width .4s ease; }
.lp-progress-text { font-size: .82rem; color: #6a7280; }

/* Curriculum */
.lp-curriculum { margin-top: 2rem; }
.lp-curriculum-head { display: flex; align-items: center; justify-content: space-between; background: var(--lp-accent); color: #fff; padding: .7rem 1.2rem; border-radius: 4px 4px 0 0; }
.lp-curriculum-head h2 { color: #fff; font-size: 1.15rem; margin: 0; }
.lp-expand-all { background: none; border: 0; color: #cfd6e4; font-size: .78rem; font-weight: 700; text-transform: uppercase; cursor: pointer; }
.lp-lesson-row { background: var(--lp-bg); border: 1px solid var(--lp-border); border-top: 0; }
.lp-lesson-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.2rem; }
.lp-lesson-link { font-weight: 600; text-decoration: none; color: var(--lp-text); flex: 1; }
.lp-lesson-link:hover { color: var(--lp-accent-2); }
.lp-step-dot { width: 18px; height: 18px; border: 2px solid #c3c9d2; border-radius: 50%; flex: 0 0 auto; position: relative; background: #fff; }
.lp-step-dot.is-done { background: var(--lp-ok); border-color: var(--lp-ok); }
.lp-step-dot.is-done::after { content: "\2713"; color: #fff; font-size: 11px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.lp-dot-sm { width: 14px; height: 14px; }
.lp-dot-sm.is-done::after { font-size: 9px; }
.lp-expand { background: none; border: 0; color: var(--lp-accent-2); font-size: .74rem; font-weight: 700; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; gap: .3em; }
.lp-caret { border: solid var(--lp-accent-2); border-width: 0 2px 2px 0; padding: 2.5px; transform: rotate(45deg); transition: transform .2s; display: inline-block; }
.lp-expand[aria-expanded="true"] .lp-caret { transform: rotate(-135deg); }
.lp-lesson-sub { padding: 0 1.2rem 1rem 3rem; display: flex; flex-direction: column; gap: .5rem; }
.lp-sub-row { display: flex; align-items: center; gap: .6rem; }
.lp-sub-row a { text-decoration: none; color: var(--lp-text); }
.lp-sub-row a:hover { color: var(--lp-accent-2); }
.lp-tag { background: var(--lp-accent-2); color: #fff; font-size: .65rem; font-weight: 700; text-transform: uppercase; padding: .2em .6em; border-radius: 3px; }
.lp-drip-note { font-size: .78rem; color: #a06a2c; }
.lp-notice { background: #fdf6e8; border: 1px solid #eed9a8; border-radius: 4px; padding: .9rem 1.2rem; }

/* Course grid */
.lp-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.lp-card { border: 1px solid var(--lp-border); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--lp-text); background: #fff; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.lp-card:hover { box-shadow: 0 6px 18px rgba(20, 30, 50, .12); transform: translateY(-2px); }
.lp-card-thumb { background: var(--lp-bg); aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lp-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lp-card-placeholder { font-size: 3rem; }
.lp-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.lp-card-body h3 { margin: 0; font-size: 1.05rem; }
.lp-card-body p { margin: 0; font-size: .88rem; color: #5d646e; }
.lp-card-price { font-weight: 700; color: var(--lp-accent-2); }

/* Focus mode */
body.lp-focus { margin: 0; background: #fff; font-family: inherit; }
.lp-focus-shell { display: flex; min-height: 100vh; }
.lp-focus-sidebar { width: 300px; flex: 0 0 300px; background: #1f2733; color: #d7dce4; overflow-y: auto; position: sticky; top: 0; max-height: 100vh; }
.lp-focus-course { padding: 1.2rem 1.1rem; border-bottom: 1px solid #323d4d; }
.lp-focus-back { color: #fff; text-decoration: none; font-weight: 700; display: block; margin-bottom: .8rem; }
.lp-focus-sidebar .lp-progress-text { color: #97a1af; }
.lp-focus-sidebar .lp-progress-track { background: #323d4d; }
.lp-focus-nav { padding: .6rem 0 2rem; }
.lp-focus-item { display: flex; align-items: center; gap: .6rem; color: #c3cad4; text-decoration: none; padding: .55rem 1.1rem; font-size: .9rem; }
.lp-focus-item:hover { background: #29323f; color: #fff; }
.lp-focus-item.is-current { background: #29323f; color: #fff; box-shadow: inset 3px 0 0 var(--lp-accent-2); }
.lp-focus-item.is-locked { opacity: .45; }
.lp-focus-lesson-link { font-weight: 700; }
.lp-focus-children { display: none; }
.lp-focus-children .lp-focus-item { padding-left: 2.2rem; }
.lp-focus-lesson.is-open .lp-focus-children { display: block; }
.lp-focus-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lp-focus-topbar { display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--lp-border); padding: .7rem 1.2rem; position: sticky; top: 0; background: #fff; z-index: 5; }
.lp-focus-crumb { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-focus-user { display: flex; align-items: center; }
.lp-focus-user img { border-radius: 50%; }
.lp-sidebar-toggle { background: none; border: 0; font-size: 1.2rem; cursor: pointer; display: none; }
.lp-focus-content { padding: 2.2rem clamp(1rem, 5vw, 4rem); max-width: 860px; width: 100%; margin: 0 auto; }
.lp-focus-content h1 { margin-top: 0; }
.lp-video { margin-bottom: 1.6rem; }
.lp-video iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 6px; }
.lp-step-actions { margin: 2rem 0; }
.lp-focus-pagination { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; border-top: 1px solid var(--lp-border); padding-top: 1.4rem; }
.lp-focus-pagination .lp-focus-next { margin-left: auto; }

@media (max-width: 860px) {
	.lp-focus-sidebar { position: fixed; z-index: 50; left: -310px; transition: left .25s ease; height: 100vh; }
	body.lp-sidebar-open .lp-focus-sidebar { left: 0; }
	.lp-sidebar-toggle { display: block; }
}

/* Quiz */
.lp-quiz { border: 1px solid var(--lp-border); border-radius: 8px; padding: 1.4rem 1.5rem; margin: 1.5rem 0; }
.lp-quiz-meta { display: flex; gap: 1.4rem; align-items: center; font-size: .85rem; color: #6a7280; margin-bottom: 1rem; }
.lp-question { border: 0; border-top: 1px solid var(--lp-border); margin: 0; padding: 1.1rem 0; }
.lp-question legend { font-weight: 700; padding: 0 0 .5rem; font-size: 1rem; }
.lp-qnum { display: inline-flex; width: 22px; height: 22px; background: var(--lp-accent); color: #fff; border-radius: 50%; align-items: center; justify-content: center; font-size: .75rem; margin-right: .4em; }
.lp-option { display: block; padding: .45rem .7rem; border: 1px solid var(--lp-border); border-radius: 5px; margin-bottom: .45rem; cursor: pointer; }
.lp-option:hover { border-color: var(--lp-accent-2); }
.lp-question.is-correct .lp-option input:checked + span,
.lp-question.is-correct legend { color: var(--lp-ok); }
.lp-question.is-wrong legend { color: #c0392b; }
.lp-text-answer, .lp-essay-answer { width: 100%; padding: .5rem .7rem; border: 1px solid var(--lp-border); border-radius: 5px; }
.lp-hint { font-size: .8rem; color: #7a828c; }
.lp-quiz-result { margin-top: 1.2rem; padding: 1.1rem 1.3rem; border-radius: 6px; background: var(--lp-bg); }
.lp-quiz-result.is-pass { background: #e8f6ef; border: 1px solid #bfe3d1; }
.lp-quiz-result.is-fail { background: #fbeeec; border: 1px solid #efc9c3; }
.lp-quiz-result h3 { margin: 0 0 .4rem; }

/* Assignment */
.lp-assignment-box { border: 1px dashed #b9c1cc; border-radius: 8px; padding: 1.2rem 1.4rem; margin: 1.5rem 0; }

/* Profile */
.lp-profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.lp-profile-head img { border-radius: 50%; }
.lp-profile-head h2 { margin: 0; }
.lp-profile-course { border: 1px solid var(--lp-border); border-radius: 8px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.lp-profile-course-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.lp-attempts { margin-top: .7rem; font-size: .87rem; }
.lp-attempts table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.lp-attempts th, .lp-attempts td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--lp-border); }

/* Login box */
.lp-login-box { max-width: 380px; border: 1px solid var(--lp-border); border-radius: 8px; padding: 1.4rem 1.6rem; }
.lp-login-box input[type="text"], .lp-login-box input[type="password"] { width: 100%; }

/* Certificate */
body.lp-certificate-page { background: #e9ebee; margin: 0; }
.lp-certificate-toolbar { text-align: center; padding: 1.2rem; }
.lp-certificate-sheet { background: #fff; width: min(940px, 92vw); margin: 0 auto 3rem; aspect-ratio: 297/210; padding: clamp(1.5rem, 5vw, 4rem); box-shadow: 0 10px 30px rgba(0,0,0,.18); border: 12px double var(--lp-accent-2); display: flex; flex-direction: column; justify-content: center; text-align: center; }
.lp-certificate-sheet h1 { font-size: 2.4rem; }
@media print {
	.lp-certificate-toolbar { display: none; }
	body.lp-certificate-page { background: #fff; }
	.lp-certificate-sheet { box-shadow: none; width: 100%; margin: 0; }
}
