/* ============================================================
   HIPAA Privacy Basics — Shared Elements CSS
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #1a2744;
  --teal:      #0a9396;
  --teal-dark: #005f61;
  --teal-light:#94d2bd;
  --white:     #ffffff;
  --gray:      #f4f4f6;
  --amber:     #e9c46a;
  --red:       #e63946;
  --text:      #1a1a2e;
  --text-muted:#555577;
  --radius:    8px;
  --shadow:    0 2px 12px rgba(0,0,0,0.10);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}

/* ── Top Navigation ───────────────────────────────────────── */
.course-nav {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.course-nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.course-nav__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.course-nav__title span { color: var(--teal-light); }

.nav-toggle {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  display: none;
}

.lesson-list {
  list-style: none;
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.lesson-list a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.lesson-list a:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.lesson-list a.active { color: var(--teal-light); font-weight: 600; }
.lesson-list .completed::after { content: ' ✓'; color: var(--teal-light); font-size: 0.75rem; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .lesson-list {
    display: none;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .lesson-list.open { display: flex; }
  .lesson-list a { padding: 0.6rem 0.75rem; font-size: 0.9rem; }
}

/* ── Hero Image ───────────────────────────────────────────── */
.lesson-hero {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (max-width: 600px) { .lesson-hero { height: 240px; } }

/* ── Lesson Header ────────────────────────────────────────── */
.lesson-header {
  background: var(--navy);
  color: var(--white);
  padding: 2.5rem 1.25rem;
}

.lesson-header__inner { max-width: 860px; margin: 0 auto; }

.lesson-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  opacity: 0.75;
}

.lesson-meta .module-badge {
  background: var(--teal);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 1;
}

.lesson-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.learning-objectives {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.learning-objectives li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.learning-objectives li::before {
  content: '→';
  color: var(--teal-light);
  flex-shrink: 0;
  margin-top: 0.05em;
}

/* ── Content Area ─────────────────────────────────────────── */
.lesson-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.lesson-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--teal);
}

.lesson-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.75rem 0 0.6rem;
}

.lesson-content p { margin-bottom: 1.1rem; }

.lesson-content ul, .lesson-content ol {
  margin: 0 0 1.1rem 1.5rem;
}

.lesson-content li { margin-bottom: 0.4rem; }

/* ── Section Images ───────────────────────────────────────── */
.section-image {
  width: 100%;
  border-radius: var(--radius);
  margin: 1.75rem 0;
  display: block;
  object-fit: cover;
}

.section-image--wide {
  width: 100vw;
  max-width: none;
  margin-left: calc(-50vw + 50%);
  border-radius: 0;
  height: 380px;
}

.image-caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: -1.25rem;
  margin-bottom: 1.75rem;
  font-style: italic;
}

/* ── Callout Blocks ───────────────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.callout-term { background: var(--gray); border-color: var(--navy); }
.callout-term .callout-label { color: var(--navy); }

.callout-citation {
  background: rgba(10,147,150,0.07);
  border-color: var(--teal);
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
}
.callout-citation .callout-label { color: var(--teal-dark); }

.callout-caution { background: rgba(233,196,106,0.15); border-color: var(--amber); }
.callout-caution .callout-label { color: #7a5c00; }

.callout-violation { background: rgba(230,57,70,0.08); border-color: var(--red); }
.callout-violation .callout-label { color: var(--red); }

.callout-best { background: rgba(148,210,189,0.2); border-color: var(--teal); }
.callout-best .callout-label { color: var(--teal-dark); }

/* ── Infographic Spreads ──────────────────────────────────── */
.infographic-spread {
  width: 100%;
  background: var(--gray);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}

.infographic-spread h3 {
  text-align: center;
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.identifier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.identifier-card {
  background: var(--white);
  border: 1px solid rgba(10,147,150,0.2);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.tier-table { width: 100%; border-collapse: collapse; }
.tier-table th {
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.85rem;
}
.tier-table td { padding: 0.6rem 1rem; border-bottom: 1px solid #ddd; font-size: 0.88rem; }
.tier-table tr:nth-child(even) td { background: var(--gray); }
.tier-table .tier-amount { font-weight: 700; color: var(--red); }

/* ── Flashcards ───────────────────────────────────────────── */
.flashcard-section { margin: 2.5rem 0; }
.flashcard-section h2 { border-bottom-color: var(--teal); }

.flashcard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.flashcard-deck {
  width: 100%;
  max-width: 600px;
}

.flashcard-card {
  width: 100%;
  height: 220px;
  perspective: 1000px;
  cursor: pointer;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.flashcard-card.flipped .flashcard-inner { transform: rotateY(180deg); }

.flashcard-front, .flashcard-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  backface-visibility: hidden;
}

.flashcard-front {
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  font-size: 1.15rem;
}

.flashcard-back {
  background: var(--teal);
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1.5;
  transform: rotateY(180deg);
}

.flashcard-hint {
  font-size: 0.75rem;
  opacity: 0.6;
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
}

.flashcard-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.flashcard-nav button {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 44px;
  min-height: 44px;
}
.flashcard-nav button:hover { background: var(--teal-dark); }

.flashcard-counter { font-size: 0.85rem; color: var(--text-muted); }

/* ── Quiz ─────────────────────────────────────────────────── */
.quiz-section { margin: 2.5rem 0; }

.quiz-question {
  background: var(--gray);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.quiz-question p {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.98rem;
}

.quiz-options { display: flex; flex-direction: column; gap: 0.5rem; }

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--white);
  font-size: 0.92rem;
  min-height: 44px;
  text-align: left;
  width: 100%;
}
.quiz-option:hover { border-color: var(--teal); background: rgba(10,147,150,0.05); }
.quiz-option.selected { border-color: var(--teal); background: rgba(10,147,150,0.1); }
.quiz-option.correct { border-color: #28a745; background: rgba(40,167,69,0.1); }
.quiz-option.incorrect { border-color: var(--red); background: rgba(230,57,70,0.08); }

.quiz-explanation {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(10,147,150,0.07);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88rem;
}
.quiz-explanation.visible { display: block; }

.quiz-check-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.2s;
  min-height: 44px;
}
.quiz-check-btn:hover { background: var(--teal-dark); }

.quiz-score {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  display: none;
}
.quiz-score.visible { display: block; }
.quiz-score .score-number { font-size: 2.5rem; font-weight: 800; color: var(--teal-light); }

/* ── Fill-in-the-Blank ────────────────────────────────────── */
.fitb-section { margin: 2.5rem 0; }

.fitb-item {
  background: var(--gray);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 2;
}

.fitb-blank {
  display: inline-block;
  border: none;
  border-bottom: 2px solid var(--teal);
  background: transparent;
  font-size: inherit;
  font-family: inherit;
  color: var(--text);
  padding: 0 0.25rem;
  min-width: 120px;
  outline: none;
  transition: border-color 0.2s;
}
.fitb-blank:focus { border-color: var(--navy); }
.fitb-blank.correct { border-color: #28a745; color: #28a745; font-weight: 600; }
.fitb-blank.incorrect { border-color: var(--red); color: var(--red); }

.fitb-check-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.75rem;
  min-height: 44px;
  transition: background 0.2s;
}
.fitb-check-btn:hover { background: var(--teal-dark); }

/* ── Lesson Summary ───────────────────────────────────────── */
.lesson-summary {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2.5rem 0;
}

.lesson-summary h2 { color: var(--teal-light); border: none; margin-top: 0; }

.lesson-summary ul { margin-left: 1.25rem; }
.lesson-summary li { margin-bottom: 0.5rem; opacity: 0.9; }

/* ── Bottom Pagination ────────────────────────────────────── */
.lesson-pagination {
  border-top: 1px solid #e0e0e0;
  padding: 1.5rem 1.25rem;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s;
  min-height: 44px;
}
.pagination-btn:hover { background: var(--teal); }
.pagination-btn--home { background: var(--gray); color: var(--navy); }
.pagination-btn--home:hover { background: var(--teal-light); }

@media (max-width: 480px) {
  .lesson-pagination { flex-direction: column; }
  .pagination-btn { width: 100%; justify-content: center; }
}

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar-wrap {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  height: 4px;
  margin-top: 0.75rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--teal-light);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── Completion Badge ─────────────────────────────────────── */
.completion-badge {
  display: none;
  background: var(--teal);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  font-weight: 600;
}
.completion-badge.visible { display: block; }

/* ── Footer ───────────────────────────────────────────────── */
.course-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.82rem;
  margin-top: 2rem;
}

.course-footer a { color: var(--teal-light); text-decoration: none; }
