/* ===== BIOINFORMATICS TEACHING KIT - COURSE STYLES ===== */

/* --- Google Font Import --- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* --- CSS Variables (Gray & Mauve) --- */
:root {
  --mauve: #8b6f8e;
  --mauve-dark: #6b4f6e;
  --mauve-light: #c9b1cc;
  --mauve-bg: #f5eef6;
  --gray-900: #1a1a2e;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --navbar-top-h: 50px;
  --navbar-main-h: 44px;
  --navbar-total-h: 94px;
}

/* --- Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--gray-700);
  background: var(--gray-100);
  line-height: 1.8;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
}

/* --- Disable Printing --- */
@media print {
  html,
  body {
    display: none !important;
  }
}

p {
  text-align: justify;
}
.footer p {
  text-align: center;
}

/* ========== DUAL NAVBAR ========== */

/* --- Navbar Top (logos) --- */
.navbar-top {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  height: var(--navbar-top-h);
  position: sticky;
  top: 0;
  z-index: 210;
}

.navbar-top .nav-container {
  max-width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-top-h);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 36px;
}
.nav-logo-img img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.nav-logo-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-logo-right img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* --- Navbar Main (hamburger + title) --- */
.navbar-main {
  background: var(--mauve-dark);
  height: var(--navbar-main-h);
  position: sticky;
  top: var(--navbar-top-h);
  z-index: 205;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.navbar-main .nav-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
}

/* --- Hamburger (mobile only) --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.4rem;
  border: none;
  background: none;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ========== APP LAYOUT ========== */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--navbar-total-h));
}

/* ========== SIDEBAR ========== */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--gray-300);
  padding: 1.25rem 0;
  position: sticky;
  top: var(--navbar-total-h);
  height: calc(100vh - var(--navbar-total-h));
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  padding: 0 1.25rem;
  margin-bottom: 0.75rem;
}

.module-group {
  margin-bottom: 0.2rem;
}

.module-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  text-decoration: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.module-header:hover {
  background: var(--gray-50);
  color: var(--mauve-dark);
}

.module-header.active {
  background: var(--mauve-bg);
  color: var(--mauve-dark);
  border-left-color: var(--mauve);
  font-weight: 700;
}

.module-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--gray-300);
  color: var(--gray-700);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.module-header.active .module-num {
  background: var(--mauve);
  color: var(--white);
}

.module-arrow {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--gray-500);
  transition: transform 0.2s ease;
}

.module-group.open .module-arrow {
  transform: rotate(90deg);
}

.sub-topics {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.module-group.open .sub-topics {
  max-height: 500px;
}

.sub-topic-link {
  display: block;
  padding: 0.35rem 1.25rem 0.35rem 3.25rem;
  font-size: 0.78rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.sub-topic-link:hover {
  color: var(--mauve-dark);
  background: var(--gray-50);
}
.sub-topic-link.active {
  color: var(--mauve-dark);
  font-weight: 600;
  border-left-color: var(--mauve-light);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 149;
}

.sidebar-overlay.show {
  display: block;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  padding: 0;
  overflow-y: auto;
}

/* ========== PAGE HERO ========== */
.page-hero {
  background: var(--mauve-bg);
  padding: 1.75rem 2.5rem;
  border-bottom: 1px solid var(--mauve-light);
}

.page-hero .module-badge {
  display: inline-block;
  background: var(--mauve);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-hero h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.2rem;
}
.page-hero p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* ========== HERO (index) ========== */
.hero {
  background: var(--mauve-bg);
  padding: 2.5rem 2.5rem;
  border-bottom: 1px solid var(--mauve-light);
}

.hero-content {
  max-width: 700px;
}

.hero .badge {
  display: inline-block;
  background: var(--mauve);
  color: var(--white);
  padding: 0.25rem 0.9rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.4rem;
  line-height: 1.2;
}
.hero .subtitle {
  font-size: 0.95rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
}

/* ========== SECTION HEADINGS ========== */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.15rem;
  padding-left: 1rem;
  border-left: 4px solid var(--mauve);
  line-height: 1.3;
}

.section-title.center {
  text-align: center;
  border-left: none;
  padding-left: 0;
}

/* ========== TOPIC CARDS (Index) ========== */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
  padding: 0.75rem 0;
}

.topic-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1.35rem;
  text-decoration: none;
  color: var(--gray-700);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.topic-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--mauve-light);
}

.topic-card .card-module-badge {
  display: inline-block;
  background: var(--mauve-bg);
  color: var(--mauve-dark);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topic-card .card-icon {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}
.topic-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--gray-900);
}
.topic-card p {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 0.6rem;
  line-height: 1.6;
}
.topic-card .card-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mauve);
}

/* ========== CONTENT CARDS ========== */
.content-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ========== STEP CARDS ========== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
  margin: 1.15rem 0;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1.15rem;
  text-align: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--mauve);
  color: var(--white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.step-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}
.step-card p {
  font-size: 0.78rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ========== TERM CARDS ========== */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.9rem;
  margin: 1.15rem 0;
}

.term-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1rem 1.15rem;
}

.term-card h4 {
  color: var(--mauve-dark);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}
.term-card p {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.55;
}

/* ========== COMPARISON CARDS ========== */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin: 1.15rem 0;
}

.comparison-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1.35rem;
  border-top: 3px solid var(--mauve);
  overflow: hidden;
  min-width: 0;
}

.comparison-card.alt {
  border-top-color: var(--mauve-light);
}
.comparison-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--gray-900);
}

.comparison-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1rem auto 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.comparison-image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ===== Image Lightbox ===== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 2rem;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  cursor: default;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 10000;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.lightbox-close:hover {
  opacity: 1;
}

/* ========== TIMELINE ========== */
.timeline {
  position: relative;
  padding-left: 32px;
  margin: 1.25rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--mauve-light);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.35rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 5px;
  width: 10px;
  height: 10px;
  background: var(--mauve);
  border: none;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px var(--white),
    0 0 0 5px var(--mauve-light);
}

.timeline-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.15rem;
}
.timeline-item p {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ========== CODE BLOCK ========== */
.code-block {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 1.15rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid #313244;
}

.code-block .code-header {
  color: var(--mauve-light);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #313244;
}

.code-block .code-green {
  color: #a6e3a1;
}
.code-block .code-blue {
  color: #89b4fa;
}

/* ========== IMAGE CONTAINER ========== */
.img-placeholder {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  margin: 1.15rem 0;
}

.img-placeholder img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.img-placeholder .placeholder-caption {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-style: italic;
  margin-top: 0.65rem;
  line-height: 1.5;
}

/* ========== INFO TABLE ========== */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gray-300);
}

.info-table thead {
  background: var(--gray-900);
  color: var(--white);
}
.info-table th {
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
}
.info-table td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--gray-300);
}
.info-table tbody tr:nth-child(even) {
  background: var(--gray-50);
}
.info-table tbody tr:hover {
  background: var(--mauve-bg);
}

.identity-high {
  background: #dcfce7 !important;
  color: #166534;
}
.identity-good {
  background: #d1fae5 !important;
  color: #065f46;
}
.identity-medium {
  background: #fef9c3 !important;
  color: #854d0e;
}
.identity-moderate {
  background: #ffedd5 !important;
  color: #9a3412;
}
.identity-low {
  background: #fee2e2 !important;
  color: #991b1b;
}

/* ========== ACCORDION ========== */
.accordion-item {
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: var(--white);
}

.accordion-header {
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
  user-select: none;
}

.accordion-header:hover {
  background: var(--gray-50);
}
.accordion-header::after {
  content: "+";
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mauve);
}
.accordion-item.open .accordion-header::after {
  content: "\2212";
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    padding 0.2s ease;
  padding: 0 1.1rem;
}

.accordion-item.open .accordion-body {
  max-height: 500px;
  padding: 0 1.1rem 1.1rem;
}

/* ========== LINK BUTTONS ========== */
.link-cards {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 1.15rem 0;
}

.link-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  background: var(--mauve);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.15s ease;
}

.link-card:hover {
  background: var(--mauve-dark);
}
.link-card .link-icon {
  font-size: 1.1rem;
}

/* ========== QUIZ LINK (replaces inline quiz on module pages) ========== */
.quiz-link-section {
  background: var(--mauve-bg);
  border: 2px solid var(--mauve-light);
  border-radius: 10px;
  padding: 1.75rem;
  text-align: center;
  margin-top: 2.5rem;
}

.quiz-link-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.quiz-link-section p {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.quiz-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--mauve);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.15s ease;
}

.quiz-link-btn:hover {
  background: var(--mauve-dark);
}

/* ========== QUIZ PAGE STYLES ========== */
.quiz-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  margin-top: 1.5rem;
}

.quiz-section .quiz-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quiz-question {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 1.15rem;
  margin-bottom: 0.9rem;
  transition: border-color 0.2s ease;
}

.quiz-question.correct {
  border-color: var(--success);
}
.quiz-question.wrong {
  border-color: var(--error);
  animation: shakeWrong 0.4s ease;
}

.quiz-question .q-number {
  font-weight: 700;
  color: var(--mauve);
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}
.quiz-question .q-text {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  color: var(--gray-900);
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.mcq-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
}

.mcq-option:hover {
  background: var(--mauve-bg);
  border-color: var(--mauve-light);
}
.mcq-option input[type="radio"] {
  accent-color: var(--mauve);
  width: 15px;
  height: 15px;
}

.mcq-option.selected-correct {
  background: #dcfce7;
  border-color: var(--success);
}
.mcq-option.selected-wrong {
  background: #fee2e2;
  border-color: var(--error);
}
.mcq-option.reveal-correct {
  background: #dcfce7;
  border-color: var(--success);
}

.btn-check {
  background: var(--mauve);
  color: var(--white);
  border: none;
  padding: 0.45rem 1.15rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-check:hover {
  background: var(--mauve-dark);
}
.btn-check:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.written-area {
  width: 100%;
  min-height: 85px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.7rem;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s ease;
}

.written-area:focus {
  outline: none;
  border-color: var(--mauve);
  box-shadow: 0 0 0 2px rgba(139, 111, 142, 0.15);
}

.btn-reveal {
  background: transparent;
  color: var(--mauve);
  border: 1.5px solid var(--mauve);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reveal:hover {
  background: var(--mauve);
  color: var(--white);
}

.sample-answer {
  display: none;
  background: var(--mauve-bg);
  border: 1px solid var(--mauve-light);
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.sample-answer.show {
  display: block;
  animation: fadeIn 0.25s ease;
}
.sample-answer strong {
  color: var(--mauve-dark);
}

.q-feedback {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.35rem;
  display: none;
}
.q-feedback.show {
  display: block;
}
.q-feedback.correct-text {
  color: var(--success);
}
.q-feedback.wrong-text {
  color: var(--error);
}

/* Back to module link (quiz pages) */
.back-to-module {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--mauve);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.back-to-module:hover {
  color: var(--mauve-dark);
  text-decoration: underline;
}

/* ========== PAGE NAV (Prev/Next) ========== */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  margin-top: 1.75rem;
  border-top: 1px solid var(--gray-300);
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  background: var(--white);
  color: var(--mauve-dark);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  transition: all 0.15s ease;
}

.page-nav a:hover {
  border-color: var(--mauve);
  background: var(--mauve-bg);
}

/* ========== ANIMATIONS ========== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children .animate-on-scroll:nth-child(1) {
  transition-delay: 0.03s;
}
.stagger-children .animate-on-scroll:nth-child(2) {
  transition-delay: 0.06s;
}
.stagger-children .animate-on-scroll:nth-child(3) {
  transition-delay: 0.09s;
}
.stagger-children .animate-on-scroll:nth-child(4) {
  transition-delay: 0.12s;
}
.stagger-children .animate-on-scroll:nth-child(5) {
  transition-delay: 0.15s;
}
.stagger-children .animate-on-scroll:nth-child(6) {
  transition-delay: 0.18s;
}
.stagger-children .animate-on-scroll:nth-child(7) {
  transition-delay: 0.21s;
}
.stagger-children .animate-on-scroll:nth-child(8) {
  transition-delay: 0.24s;
}
.stagger-children .animate-on-scroll:nth-child(9) {
  transition-delay: 0.27s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shakeWrong {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

/* ========== HIGHLIGHT / NOTE BOXES ========== */
.highlight-box {
  background: var(--mauve-bg);
  border-left: 3px solid var(--mauve);
  padding: 0.8rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 0.9rem 0;
  font-size: 0.88rem;
}

.note-box {
  background: #fffbeb;
  border-left: 3px solid var(--warning);
  padding: 0.8rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 0.9rem 0;
  font-size: 0.88rem;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--mauve-dark);
  color: var(--mauve-bg);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  border-top: 3px solid var(--mauve);
}

.footer a {
  color: var(--white);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
  color: var(--mauve-light);
}
.footer .footer-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}
.footer .footer-divider {
  width: 50px;
  height: 2px;
  background: var(--mauve-light);
  margin: 0.75rem auto;
  border-radius: 2px;
}
.footer .footer-copy {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--mauve-light);
}

/* ========== UTILITY ========== */
.text-center {
  text-align: center;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--navbar-total-h);
    left: 0;
    bottom: 0;
    width: 270px;
    z-index: 150;
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .hero {
    padding: 1.75rem 1.25rem;
  }
  .hero h1 {
    font-size: 1.5rem;
  }

  .page-hero {
    padding: 1.25rem;
  }
  .page-hero h1 {
    font-size: 1.25rem;
  }

  .container {
    padding: 1.25rem;
  }

  .nav-logo-img img,
  .nav-logo-right img {
    height: 28px;
  }
  .navbar-main .nav-title {
    font-size: 0.85rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .page-nav {
    flex-direction: column;
    gap: 0.6rem;
  }
  .page-nav a {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .terms-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== PRINT ========== */
@media print {
  .navbar-top,
  .navbar-main,
  .sidebar,
  .footer,
  .page-nav,
  .hamburger,
  .sidebar-overlay {
    display: none;
  }
  .app-layout {
    grid-template-columns: 1fr;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
  .quiz-section {
    break-inside: avoid;
  }
  body {
    font-size: 11pt;
  }
}
