/* ═══════════════════════════════════════════
   LESSONS.CSS — Catalog + Lesson Reader
   CyberEduc
═══════════════════════════════════════════ */

/* ══════════════════════════
   CATALOG — PAGE HEADER
══════════════════════════ */
.lessons-header {
  padding: 140px 80px 64px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.lessons-header::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(0, 255, 136, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.lessons-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.lessons-header .section-label {
  margin-bottom: 16px;
}

.lessons-title {
  font-size: clamp(36px, 5vw, 60px);
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.lessons-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Catalog progress bar ── */
.catalog-progress {
  max-width: 400px;
  margin: 0 auto;
}

.cp-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cp-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.cp-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════
   FILTER BAR
══════════════════════════ */
.filter-bar {
  padding: 0 80px 48px;
  position: sticky;
  top: 68px;
  z-index: 50;
  background: rgba(10, 12, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.filter-bar-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding-top: 16px;
}

.filter-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 7px 18px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
}

.filter-btn.active {
  color: var(--green);
  border-color: rgba(0, 255, 136, 0.4);
  background: var(--green-glow-s);
}

/* ══════════════════════════
   CATALOG GRID
══════════════════════════ */
.catalog-section {
  padding: 48px 80px 120px;
  max-width: var(--container);
  margin: 0 auto;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Catalog Card ── */
.catalog-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-s);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.catalog-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--green-glow-s), transparent 60%);
  opacity: 0;
  transition: var(--transition-s);
  pointer-events: none;
}

.catalog-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.catalog-card:hover::before {
  opacity: 1;
}

.catalog-card.is-done {
  border-color: rgba(0, 255, 136, 0.2);
}

.cc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.cc-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cc-icon {
  font-size: 32px;
  line-height: 1;
}

.cc-title {
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.cc-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.cc-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cc-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
}

.cc-done {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  background: var(--green-glow-s);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 100px;
  padding: 3px 10px;
}

/* ══════════════════════════
   LESSON READER — TOP BAR
══════════════════════════ */
.lesson-topbar {
  position: sticky;
  top: 68px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 80px;
  background: rgba(10, 12, 15, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.back-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.back-btn:hover {
  color: var(--green);
}

.lesson-topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ══════════════════════════
   LESSON READER — LAYOUT
══════════════════════════ */
.lesson-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  min-height: calc(100vh - 140px);
}

/* ── Table of Contents ── */
.lesson-toc {
  padding: 48px 32px 48px 0;
  position: sticky;
  top: 130px;
  height: fit-content;
  border-right: 1px solid var(--border);
}

.toc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

#toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

#toc-list li a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: var(--transition);
  line-height: 1.4;
  border-left: 2px solid transparent;
}

#toc-list li a:hover {
  color: var(--text);
  background: var(--bg-3);
}

#toc-list li a.toc-active {
  color: var(--green);
  border-left-color: var(--green);
  background: var(--green-glow-s);
}

.toc-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.toc-bar {
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 6px;
}

.toc-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.toc-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
}

/* ── Main Content ── */
.lesson-main {
  padding: 48px 0 48px 48px;
}

/* Lesson hero */
.lesson-hero {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.lesson-icon-big {
  font-size: 48px;
  display: block;
  margin-bottom: 20px;
}

.lesson-main-title {
  font-size: clamp(28px, 3.5vw, 44px);
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.lesson-main-desc {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
}

/* ══════════════════════════
   LESSON SECTIONS
══════════════════════════ */

/* Text section */
.ls-text {
  margin-bottom: 40px;
  scroll-margin-top: 160px;
}

.ls-text h3 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.ls-text p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 640px;
}

/* Example section */
.ls-example {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  scroll-margin-top: 160px;
}

.ls-example-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.ls-example-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-red    { background: var(--red); }
.dot-green  { background: var(--green); }

.ls-example-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.ls-ex-col {
  padding: 24px;
}

.ls-ex-col:first-child {
  border-right: 1px solid var(--border);
}

.ls-ex-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.ls-ex-label.fake { color: var(--red); }
.ls-ex-label.real { color: var(--green); }

.ls-ex-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}

.ls-example-explanation {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  background: rgba(0, 0, 0, 0.2);
}

/* Warning section */
.ls-warning {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 40px;
  scroll-margin-top: 160px;
}

.ls-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ls-warning p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
}

/* ══════════════════════════
   QUIZ BLOCK
══════════════════════════ */
.quiz-block {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.quiz-header {
  margin-bottom: 40px;
}

.quiz-title {
  font-size: 28px;
  color: var(--text);
  margin: 12px 0 8px;
}

.quiz-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* Quiz question */
.quiz-question {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.qq-number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.qq-text {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.qq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qq-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
  color: var(--text-muted);
  text-align: left;
  width: 100%;
  font-family: var(--font-display);
  line-height: 1.5;
}

.qq-option:hover {
  border-color: var(--border-light);
  color: var(--text);
  background: var(--bg-2);
}

.qq-option.selected {
  border-color: rgba(68, 153, 255, 0.5);
  background: rgba(68, 153, 255, 0.06);
  color: var(--text);
}

.qq-option.correct {
  border-color: rgba(0, 255, 136, 0.5);
  background: rgba(0, 255, 136, 0.06);
  color: var(--green);
}

.qq-option.wrong {
  border-color: rgba(255, 68, 85, 0.5);
  background: rgba(255, 68, 85, 0.06);
  color: var(--red);
}

.qq-option-letter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 20px;
  padding-top: 1px;
  flex-shrink: 0;
}

/* Explanation after submit */
.qq-explanation {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(0, 255, 136, 0.05);
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  display: none;
}

.qq-explanation.show {
  display: block;
}

/* Submit button area */
.quiz-actions {
  margin-top: 24px;
  text-align: center;
}

/* ── Quiz Result ── */
.quiz-result {
  margin-top: 40px;
  padding: 40px;
  background: var(--bg-2);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: var(--radius-lg);
  text-align: center;
}

.qr-score-wrap {
  margin-bottom: 32px;
}

.qr-score {
  font-family: var(--font-mono);
  font-size: 56px;
  color: var(--green);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}

.qr-label {
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
}

.qr-badge {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 32px;
  text-align: left;
}

.qr-badge-icon {
  font-size: 32px;
}

.qr-badge-name {
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 2px;
}

.qr-badge-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
}

.qr-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════
   RESPONSIVE
══════════════════════════ */
@media (max-width: 1024px) {
  .lessons-header   { padding: 120px 40px 48px; }
  .filter-bar       { padding: 0 40px 32px; }
  .catalog-section  { padding: 40px 40px 80px; }
  .catalog-grid     { grid-template-columns: repeat(2, 1fr); }

  .lesson-topbar    { padding: 14px 40px; }
  .lesson-layout    { grid-template-columns: 1fr; padding: 0 40px; }
  .lesson-toc       { display: none; }
  .lesson-main      { padding: 40px 0; }
}

@media (max-width: 768px) {
  .lessons-header   { padding: 110px 24px 40px; }
  .filter-bar       { padding: 0 24px 24px; }
  .catalog-section  { padding: 32px 24px 64px; }
  .catalog-grid     { grid-template-columns: 1fr; }

  .lesson-topbar    { padding: 12px 24px; }
  .lesson-layout    { padding: 0 24px; }

  .ls-example-body  { grid-template-columns: 1fr; }
  .ls-ex-col:first-child { border-right: none; border-bottom: 1px solid var(--border); }

  .quiz-result      { padding: 24px; }
  .qr-score         { font-size: 40px; }
}

/* ══════════════════════════
   FOOTER
══════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 64px 80px 32px;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 64px;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col h4 {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--green);
}

.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}