/* ===== LEARN PAGES STYLES ===== */
/* Shared styles for /learn/* pages (beginner, advanced, pro) */

/* Common section styling */
.learn-content section {
  margin-bottom: 48px;
  scroll-margin-top: 80px;
}

.learn-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-l);
  margin-bottom: 16px;
  margin-top: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(247, 147, 26, 0.3);
}

.learn-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-l);
  margin-top: 20px;
  margin-bottom: 12px;
}

.learn-content p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
}

.learn-content p:last-child {
  margin-bottom: 0;
}

.learn-content strong {
  color: var(--text-l);
  font-weight: 600;
}

.learn-content em {
  color: var(--text);
  font-style: italic;
}

/* Links — exclude buttons with :not() to avoid specificity wars */
.learn-content a:not(.cta-link):not(.cta-btn):not(.section-pw-btn):not(.card-button):not(.quiz-btn):not([class*="page-nav"]):not([class*="learn-nav"]) {
  color: #f7931a;
  text-decoration: none;
  transition: color 0.15s ease-out;
}

.learn-content a:not(.cta-link):not(.cta-btn):not(.section-pw-btn):not(.card-button):not(.quiz-btn):not([class*="page-nav"]):not([class*="learn-nav"]):hover {
  color: #e8850f;
  text-decoration: underline;
}

/* Lists — clean, professional, readable */
.learn-content ul, .learn-content ol:not(.steps) {
  margin: 16px 0 16px 0;
  padding-left: 24px;
}

.learn-content ul {
  list-style: none;
  padding-left: 0;
}

.learn-content ul:not(.mistake-list):not(.steps):not(.card-topics) > li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

.learn-content ul:not(.mistake-list):not(.steps):not(.card-topics) > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.85em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f7931a;
}

.learn-content ol:not(.steps) > li {
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  padding-left: 4px;
}

.learn-content ol:not(.steps) > li::marker {
  color: #f7931a;
  font-weight: 700;
}

.learn-content li strong {
  color: var(--text-l);
}

.learn-content li em {
  font-style: italic;
}

/* TOC list reset — prevent bullets inside #toc */
#toc ul > li {
  position: static;
  padding-left: 0;
}

#toc ul > li::before {
  display: none;
}

/* Nested lists */
.learn-content ul ul, .learn-content ol ol,
.learn-content ul ol, .learn-content ol ul {
  margin-top: 8px;
  margin-bottom: 4px;
}

.learn-content ul ul > li::before {
  background: var(--text-m);
  width: 5px;
  height: 5px;
  top: calc(0.85em - 2.5px);
}

/* Nested lists inside steps inherit step font-size */
.steps ul > li {
  font-size: inherit;
}

.learn-content li > ul, .learn-content li > ol {
  margin-top: 8px;
}

/* Tables — scrollable without visible scrollbar */
.table-container {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 10px;
  border: 1px solid var(--brd);
  max-width: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.table-container::-webkit-scrollbar {
  display: none;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: var(--bg-s);
}

table th {
  background: rgba(247, 147, 26, 0.08);
  color: var(--text-l);
  font-weight: 600;
  font-size: 13px;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--brd);
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--brd);
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}

table td strong {
  font-size: inherit;
  color: var(--text-l);
}

table tbody tr:last-child td {
  border-bottom: none;
}

table tbody tr:hover {
  background: rgba(247, 147, 26, 0.04);
}

.table-action {
  text-align: center;
  white-space: nowrap;
}

/* CTA links in tables */
.cta-link {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(135deg, #f7931a, #e8850f);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, color 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out;
  border: none;
  box-shadow: 0 2px 8px rgba(247, 147, 26, 0.25);
  white-space: nowrap;
}

.cta-link:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(247, 147, 26, 0.4);
  text-decoration: none;
}

.cta-link:active {
  transform: scale(0.97);
}

/* Steps — numbered step-by-step list */
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
}

.steps > li {
  margin-bottom: 16px;
  padding: 20px 20px 20px 56px;
  position: relative;
  counter-increment: step-counter;
  background: var(--bg-s);
  border: 1px solid var(--brd);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.steps > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 16px;
  top: 20px;
  width: 28px;
  height: 28px;
  background: rgba(247, 147, 26, 0.15);
  border: 2px solid #f7931a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #f7931a;
  font-size: 13px;
}

.steps > li strong:first-child {
  color: var(--text-l);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

/* Note & Warning & Tip boxes */
.note-box, .warning-box, .tip-box {
  padding: 18px 20px;
  border-radius: 10px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.7;
  border-left: 4px solid;
}

.note-box {
  background: rgba(56, 189, 248, 0.06);
  border-left-color: #38bdf8;
  color: var(--text);
}

.note-box strong { color: #38bdf8; }

.warning-box {
  background: rgba(239, 68, 68, 0.06);
  border-left-color: #ef4444;
  color: var(--text);
}

.warning-box strong { color: #ef4444; }

.tip-box {
  background: rgba(34, 197, 94, 0.06);
  border-left-color: #22c55e;
  color: var(--text);
}

.tip-box strong { color: #22c55e; }

/* Learn hub cards */
.learn-card {
  background: var(--bg-s);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 28px;
  transition: transform 0.2s ease-out, border-color 0.2s ease-out, box-shadow 0.2s ease-out, background 0.2s ease-out, color 0.2s ease-out;
}

.learn-card:hover {
  border-color: var(--brd-h);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Section reveal animation */
.learn-content section.will-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.learn-content section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Quiz container */
#quiz-container {
  margin: 32px 0;
  padding: 28px;
  background: var(--bg-s);
  border: 1px solid var(--brd);
  border-radius: 12px;
  min-height: 200px;
}

#quiz-container:empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

#quiz-container:empty::after {
  content: 'Loading quiz...';
  color: var(--text-m);
  font-size: 14px;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid #f7931a;
  padding-left: 16px;
  margin: 24px 0;
  color: var(--text-m);
  font-style: italic;
}

blockquote p {
  margin-bottom: 8px;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code blocks */
pre {
  background: var(--bg);
  border: 1px solid var(--brd);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

pre::-webkit-scrollbar {
  display: none;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: #86efac;
}

pre code {
  background: none;
  padding: 0;
  color: #94a3b8;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--brd);
  margin: 32px 0;
}

/* ===== QUIZ STYLES ===== */
.quiz-progress { height: 4px; background: var(--brd); border-radius: 2px; margin-bottom: 20px; overflow: hidden; }
.quiz-progress-bar { height: 100%; background: #f7931a; border-radius: 2px; transition: width 0.3s ease; }
.quiz-counter { font-size: 13px; color: var(--text-m); margin-bottom: 8px; }
.quiz-question { font-size: 18px; font-weight: 600; color: var(--text-l); margin-bottom: 20px; line-height: 1.5; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.quiz-option {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-s); border: 1px solid var(--brd); border-radius: 8px;
  cursor: pointer; transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, color 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out;
}
.quiz-option:hover { border-color: var(--brd-h); background: rgba(247,147,26,0.04); }
.quiz-option.selected { border-color: #f7931a; background: rgba(247,147,26,0.08); }
.quiz-option input { display: none; }
.quiz-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--brd-h);
  flex-shrink: 0; transition: border-color 0.15s, background 0.15s;
}
.quiz-option.selected .quiz-radio { border-color: #f7931a; background: #f7931a; box-shadow: inset 0 0 0 3px var(--bg-s); }
.quiz-option-text { font-size: 15px; color: var(--text); }
.quiz-actions { display: flex; gap: 10px; justify-content: flex-end; }
.quiz-btn {
  padding: 14px 36px; border-radius: 10px; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, color 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out; border: none;
  font-family: 'Inter', system-ui, sans-serif;
}
.quiz-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.quiz-btn:active { transform: scale(0.97); }
.quiz-btn-next { background: linear-gradient(135deg, #f7931a, #e8850f); color: #fff; box-shadow: 0 2px 8px rgba(247,147,26,0.25); }
.quiz-btn-next:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(247,147,26,0.4); color: #fff; text-decoration: none; }
.quiz-btn-back { background: var(--bg); color: var(--text-l); border: 1px solid var(--brd-h); box-shadow: none; }
.quiz-btn-back:hover { border-color: #f7931a; color: #f7931a; background: rgba(247,147,26,0.1); transform: translateY(-2px); text-decoration: none; }

/* Quiz result */
.quiz-result { text-align: center; padding: 32px 16px; margin-bottom: 24px; }
.quiz-result-icon { font-size: 48px; margin-bottom: 12px; }
.quiz-result-score { font-size: 36px; font-weight: 700; color: var(--text-l); }
.quiz-result-pct { font-size: 16px; color: var(--text-m); margin-bottom: 12px; }
.quiz-result-title { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.quiz-pass .quiz-result-title { color: #22c55e; }
.quiz-fail .quiz-result-title { color: #f7931a; }
.quiz-result-desc { font-size: 14px; color: var(--text); }

/* Quiz review */
.quiz-review { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.quiz-review-item {
  display: flex; gap: 12px; padding: 12px 14px;
  background: var(--bg-s); border: 1px solid var(--brd); border-radius: 8px;
}
.quiz-review-item.correct { border-left: 3px solid #22c55e; }
.quiz-review-item.wrong { border-left: 3px solid #ef4444; }
.quiz-review-status { font-size: 18px; flex-shrink: 0; }
.quiz-review-item.correct .quiz-review-status { color: #22c55e; }
.quiz-review-item.wrong .quiz-review-status { color: #ef4444; }
.quiz-review-q { font-size: 14px; font-weight: 600; color: var(--text-l); margin-bottom: 4px; }
.quiz-review-a { font-size: 13px; color: var(--text); }
.quiz-review-correct { font-size: 13px; color: #22c55e; margin-top: 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .learn-content section {
    margin-bottom: 32px;
  }

  .learn-content h2 {
    font-size: 24px;
    padding-bottom: 10px;
  }

  .learn-content h3 {
    font-size: 18px;
  }

  .learn-content p {
    font-size: 15px;
    line-height: 1.65;
  }

  .learn-content ul:not(.mistake-list):not(.steps):not(.card-topics) > li,
  .learn-content ol:not(.steps) > li {
    font-size: 15px;
    margin-bottom: 10px;
    line-height: 1.65;
  }

  .learn-content ul:not(.mistake-list):not(.steps):not(.card-topics) > li::before {
    top: calc(0.825em - 3px);
  }

  /* Steps responsive — tablet */
  .steps > li {
    padding: 16px 16px 16px 48px;
    font-size: 14px;
  }
  .steps > li:before {
    left: 12px;
    top: 16px;
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .steps > li strong:first-child {
    font-size: 15px;
  }

  table th {
    padding: 12px 14px;
    font-size: 11px;
  }

  table td {
    padding: 12px 14px;
    font-size: 13px;
  }

  .cta-link {
    padding: 8px 16px;
    font-size: 12px;
  }

  .table-container {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: none;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  pre {
    padding: 12px;
    font-size: 12px;
    margin: 12px -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  code {
    font-size: 12px;
  }

  .note-box, .warning-box, .tip-box {
    padding: 14px 16px;
    margin: 16px 0;
    font-size: 13px;
  }

  #quiz-container {
    padding: 20px;
    margin: 24px 0;
  }

  .quiz-question {
    font-size: 16px;
  }

  .quiz-option {
    padding: 12px 14px;
  }

  .quiz-option-text {
    font-size: 14px;
  }

  .quiz-btn {
    padding: 12px 24px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .learn-content section {
    margin-bottom: 24px;
  }

  .learn-content h2 {
    font-size: 20px;
    padding-bottom: 8px;
  }

  .learn-content h3 {
    font-size: 16px;
    margin-top: 16px;
  }

  .learn-content p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  .learn-content ul:not(.mistake-list):not(.steps):not(.card-topics) > li,
  .learn-content ol:not(.steps) > li {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.6;
  }

  .learn-content ul:not(.mistake-list):not(.steps):not(.card-topics) > li {
    padding-left: 16px;
  }

  .learn-content ul:not(.mistake-list):not(.steps):not(.card-topics) > li::before {
    top: calc(0.8em - 2.5px);
    width: 5px;
    height: 5px;
  }

  .learn-content ol:not(.steps) {
    padding-left: 20px;
  }

  /* Steps responsive — mobile */
  .steps > li {
    padding: 14px 14px 14px 42px;
    margin-bottom: 12px;
    font-size: 13px;
  }
  .steps > li:before {
    left: 10px;
    top: 14px;
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  .steps > li strong:first-child {
    font-size: 14px;
  }

  .table-container {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: none;
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  table th {
    padding: 10px 12px;
    font-size: 10px;
  }

  table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .cta-link {
    padding: 7px 14px;
    font-size: 11px;
  }

  pre {
    padding: 10px;
    font-size: 11px;
  }

  code {
    font-size: 11px;
  }

  blockquote {
    margin: 16px 0;
    padding-left: 12px;
  }

  .note-box, .warning-box, .tip-box {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 8px;
  }

  #quiz-container {
    padding: 16px;
    margin: 20px 0;
  }

  .quiz-question {
    font-size: 15px;
  }

  .quiz-option {
    padding: 10px 12px;
    gap: 10px;
  }

  .quiz-option-text {
    font-size: 13px;
  }

  .quiz-btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .quiz-result-score {
    font-size: 28px;
  }

  .quiz-review-item {
    padding: 10px 12px;
    gap: 8px;
  }

  .quiz-review-q {
    font-size: 13px;
  }

  .quiz-review-a, .quiz-review-correct {
    font-size: 12px;
  }
}
