/* ============================================================
   CSS riêng cho Hóa học 10 - Chương 3 (Liên kết hóa học).
   Không phụ thuộc periodic-table.css của Chương 2 (tự chứa, độc lập theo
   đúng quy ước từng chương) — có lặp lại vài class nhỏ (chip, filter) là
   chủ ý, để sửa Chương 3 không ảnh hưởng Chương 2 và ngược lại.
   Ưu tiên MOBILE: khối chạm (button/select) cao tối thiểu ~46px, chữ đủ
   lớn để đọc không cần zoom, các khối xếp dọc (column) khi màn hẹp.
   ============================================================ */

/* --- Bộ chọn nguyên tố + filter chip (dùng chung octet/ion/bond/luyện tập) --- */
.lab-select-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 18px; }
.lab-select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
  font-family: "IBM Plex Mono", monospace; min-height: 46px;
}
.pt-filters { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-bottom: 14px; }
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--ink-soft);
  min-height: 38px; transition: all 0.12s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue); border-color: var(--blue); color: white; }

/* --- Khối tóm tắt kết quả — LUÔN đặt ngay trên hình vẽ để mobile thấy
       ngay không cần cuộn --- */
.lab-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; min-height: 58px; }
.lab-badge {
  flex-shrink: 0; width: 58px; height: 58px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; color: white; font-weight: 700; font-size: 17px;
  font-family: "IBM Plex Mono", monospace; text-align: center; line-height: 1.1; padding: 4px;
}
.lab-badge.small { width: 44px; height: 44px; font-size: 14px; border-radius: 10px; }
.lab-summary-title { font-size: 16px; font-weight: 700; }
.lab-summary-tendency { font-size: 14px; font-weight: 600; margin-top: 3px; }

.lab-svg-wrap { max-width: 320px; margin: 0 auto 8px; text-align: center; }
.lab-svg-wrap svg { width: 100%; height: auto; }
.lab-svg-caption { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }

.ion-before-after { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ion-before-after .lab-svg-wrap { flex: 1 1 220px; max-width: 240px; }
.ion-arrow { font-size: 26px; color: var(--blue); font-weight: 700; flex-shrink: 0; }
#ion-after-wrap.hidden { display: none; }

.ion-pair-row, .ion-pair-card { display: flex; }
.ion-pair-row { align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.ion-pair-card {
  flex-direction: column; align-items: center; gap: 8px; border: 1.5px solid; border-radius: var(--radius);
  padding: 14px 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); min-width: 130px;
}
.ion-pair-plus { font-size: 20px; font-weight: 700; color: var(--ink-soft); }

.lab-cta-btn {
  display: block; width: 100%; padding: 15px; font-size: 16px; font-weight: 700; color: white;
  background: var(--blue); border: none; border-radius: 12px; cursor: pointer; margin-top: 8px;
  min-height: 50px;
}
.lab-cta-btn:disabled { background: #b8bfe0; cursor: not-allowed; }
.lab-cta-btn:hover:not(:disabled) { background: var(--blue-dark); }

/* --- Tab Lý thuyết --- */
.theory-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.theory-toc-item {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 13px;
  color: var(--blue-dark); text-decoration: none; font-weight: 600; background: var(--card);
}
.theory-lesson { margin-bottom: 36px; scroll-margin-top: 16px; }
.theory-lesson-title { font-size: 19px; font-weight: 700; margin-bottom: 12px; border-bottom: 2px solid var(--line); padding-bottom: 8px; }
.theory-body p { line-height: 1.7; margin: 0 0 12px; font-size: 15px; }
.theory-body ul { margin: 0 0 14px; padding-left: 20px; line-height: 1.7; font-size: 15px; }
.theory-body li { margin-bottom: 6px; }
.theory-callout { background: #eef0fa; border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.theory-callout-title { font-weight: 700; margin-bottom: 8px; color: var(--blue-dark); }
.theory-callout ul { margin: 0; padding-left: 20px; }
.theory-figure { margin: 18px 0; text-align: center; }
.theory-figure img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.theory-figure figcaption { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
.theory-link-tab { color: var(--blue); font-weight: 600; text-decoration: none; }
.theory-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13.5px; }
.theory-table th, .theory-table td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.theory-table th { background: #f5f6fb; font-weight: 700; }
.theory-note { font-size: 13px; color: var(--ink-soft); font-style: italic; }

/* --- Tab Luyện tập --- */
.practice-count { font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 16px; font-weight: 600; }
.practice-progress-track { height: 8px; background: #eef0fa; border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.practice-progress-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.2s; }
.practice-progress-label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-bottom: 18px; }

.quiz-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; }
.quiz-topic { font-size: 12px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.quiz-question { font-size: 16.5px; font-weight: 600; line-height: 1.5; margin-bottom: 18px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  text-align: left; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: white; color: var(--ink); font-size: 14.5px; line-height: 1.45; cursor: pointer; min-height: 48px;
  transition: border-color 0.12s, background 0.12s; font-weight: 400;
}
.quiz-option:hover:not(.disabled) { border-color: var(--blue); background: #f5f7ff; }
.quiz-option.disabled { cursor: default; }
.quiz-option.correct { border-color: #2f9e6f; background: #e9f8f1; color: #14532d; font-weight: 700; }
.quiz-option.wrong { border-color: #e05263; background: #fdedef; color: #7f1d2b; }
.quiz-explain { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: #f5f6fb; }
.quiz-explain.hidden { display: none; }
.explain-verdict { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.explain-text { font-size: 14px; line-height: 1.6; color: var(--ink); }

.score-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 12px 0 24px; }
.score-ring {
  --pct: 0;
  position: relative;
  width: 130px; height: 130px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--blue) calc(var(--pct) * 1%), #eef0fa 0);
  font-size: 22px; font-weight: 700; font-family: "IBM Plex Mono", monospace;
}
.score-ring::before {
  content: ""; position: absolute; width: 104px; height: 104px; border-radius: 50%; background: white;
}
.score-ring span { position: relative; z-index: 1; }
.score-text { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.review-title { font-weight: 700; margin-bottom: 12px; }
.review-item { border-left: 3px solid #e05263; background: #fdedef; border-radius: 0 10px 10px 0; padding: 12px 14px; margin-bottom: 10px; }
.review-q { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.review-a { font-size: 13.5px; margin-bottom: 3px; }
.review-a.wrong-a { color: #e05263; }
.review-a.correct-a { color: #2f9e6f; font-weight: 600; }
.review-explain { font-size: 13px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

/* --- Responsive: màn hẹp (điện thoại) --- */
@media (max-width: 480px) {
  .lab-badge { width: 50px; height: 50px; font-size: 15px; }
  .lab-summary-title { font-size: 14.5px; }
  .quiz-question { font-size: 15.5px; }
  .score-ring { width: 110px; height: 110px; font-size: 19px; }
  .score-ring::before { width: 86px; height: 86px; }
}
