@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Base layout */

html, body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #374151; /* Gray 700 */
  background-color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* Firefox Standard */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* Page container */

.page {
  max-width: 100%; /* Fill available content area */
  margin: 0 auto;
  padding: 20px 28px 32px; /* tighter top padding for higher content density */
}
.page img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
/* Icons within a sentence stay in-line with the text. A figure that is the only
   child of its paragraph/list-item still block-centres (via :only-child above). */
.page p img:not(:only-child),
.page li img:not(:only-child),
.page span img,
.page a img,
.page td img,
.page th img,
.page h1 img, .page h2 img, .page h3 img, .page h4 img {
  display: inline-block;
  width: auto;
  margin: 0 0.2em;
  vertical-align: middle;
}
/* Breadcrumbs */
.lesson-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem; /* 20% smaller */
  color: #64748b;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.lesson-breadcrumb .separator {
  color: #cbd5e1;
  font-size: 0.8em;
}

.lesson-breadcrumb .current {
  color: #903ea0; /* Matching the header theme */
  font-weight: 600;
}

/* Headings */


h1 {
  font-size: 1.75rem; /* slightly bigger for clear top-level */
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.5em;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #111827;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.68rem; /* 20% smaller */
  color: #64748b;
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.lesson-meta span:not(:last-child)::after {
  content: "•";
  margin-left: 12px;
  opacity: 0.5;
}

h2 {
  font-size: 1.2rem; /* keep readable but distinct */
  font-weight: 600;
  margin-top: 2em;   /* more separation from previous content */
  margin-bottom: 0.5em;
  color: #111827;
}

h3 {
  font-size: 0.95rem; /* clearly smaller than h2 */
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.3em;
  color: #374151; /* slightly lighter than h2 */
}

/* Text elements */

p {
  margin: 0 0 1.5em;
  color: #4b5563; /* Gray 600 */
  font-size: 0.85rem; /* 20% smaller */
}

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

a {
  color: #4338ca; /* Indigo 700 - Higher contrast (7:1+) against white */
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover,
a:focus {
  border-bottom-color: #4338ca;
}

/* Lists */

ul, ol {
  margin: 0.5em 0 0.75em 1.4em;
  padding: 0;
  color: #4b5563;
}

li {
  margin-bottom: 0.5em;
}

/* Utility sections (e.g., intro, note, tip) */

.section-intro {
  background-color: #eff6ff; /* Blue 50 */
  border-left: 3px solid #3b82f6; /* Blue 500 */
  padding: 20px 24px;
  border-radius: 8px;
  margin-bottom: 1.5em;
}

.section-note {
  background-color: #fffbeb; /* Amber 50 */
  border-left: 3px solid #f59e0b; /* Amber 500 */
  padding: 20px 24px;
  border-radius: 8px;
  margin: 1.5em 0;
  font-size: 0.8rem; /* 20% smaller */
}

/* Cards / panels for steps or concepts */

.card {
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 32px;
  margin: 32px 0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.03);
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.5em;
  color: #102a43;
}

.card-subtitle {
  font-size: 0.72rem; /* 20% smaller */
  color: #6b7280;
  margin-bottom: 0.5em;
}

/* Step list for “configuration steps” */

.steps {
  counter-reset: step-counter;
  margin: 1em 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 42px;
  margin-bottom: 20px;
}

.steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background-color: #e0e7ff; /* Indigo 100 */
  color: #4338ca; /* Indigo 700 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem; /* 20% smaller */
  font-weight: 600;
}

/* Definition-style blocks for parameters */

.param-list {
  margin: 0.75em 0 1em;
  padding: 0;
  list-style: none;
}

.param-item {
  margin-bottom: 0.6em;
}

.param-name {
  font-weight: 600;
  color: #102a43;
  display: inline-block;
  min-width: 140px;
}

.param-value {
  color: #52606d;
}

/* Tables (for tiers, parameters etc.) */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.8rem; /* 20% smaller */
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

thead {
  background-color: #f9fafb;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 16px;
  text-align: left;
}

th {
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Code / inline technical terms */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85em;
  background-color: #f3f4f6;
  color: #db2777; /* Pink 600 */
  padding: 3px 6px;
  border-radius: 6px;
}

/* Callouts for “important”, “warning” */

.callout-important {
  border-left: 3px solid #ef4444;
  background-color: #fef2f2;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 1.5em 0;
}

.callout-success {
  border-left: 3px solid #10b981;
  background-color: #ecfdf5;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 1.5em 0;
}

/* Layout helpers */

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
}
/* Make list text match paragraph text exactly */
li {
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.6;
}
/* IMAGE ZOOM OVERLAY */
.image-zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: zoom-out;
}

.image-zoom-overlay img {
  max-width: 95%;
  max-height: 95%;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  border-radius: 4px;
}

.page img {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.page img:hover {
  transform: scale(1.02);
}

/* ACCORDION */

/* Accordion header */

.accordion-header {
  cursor: pointer;
  background: linear-gradient(90deg, #f3e8ff, #faf5ff);
  border: 1px solid #e9d5ff;
  padding: 16px 40px 16px 20px; /* extra right space for arrow */
  border-radius: 10px;
  margin-top: 24px;
  position: relative;
  transition: background 0.2s ease;
}

/* Chevron arrow */

.accordion-header::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: translateY(-50%) rotate(45deg); /* Down state */
  transition: transform 0.25s ease;
}

/* Rotate to Up when open */

.accordion-header.open::after {
  transform: translateY(-50%) rotate(-135deg);
}

.accordion-step + div {
  margin-left: 12px;   /* controls indent */
}

/* Question styling */
.quiz-form {
  margin-top: 20px;
}

.question-block {
  margin-bottom: 28px;
}

.question {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1;
}

.options label {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;   /* reduced from 8px */
  line-height: 1.6;     /* tighter line height */
  cursor: pointer;
}

/* Improve radio spacing */
.options input[type="radio"] {
  margin-right: 6px;
}

/* Button spacing */
.quiz-actions {
  margin-top: 32px;
}

/* Button styling aligned with modern UI */
.primary-btn {
  background: linear-gradient(135deg, #7a2e8a, #9338a6);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(122, 46, 138, 0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(122, 46, 138, 0.35);
}

.primary-btn:active {
  transform: translateY(0);
}

/* Result box */
.result-box {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 6px;
  background: #f3f6fb;
  font-weight: 600;
  display: none;
}

pre {
  background: #f4f6f8;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid #ddd;
  overflow-x: auto;
}

code {
  font-family: Consolas, monospace;
  font-size: 14px;
}

@media (max-width: 768px) {
  .two-column {
    grid-template-columns: 1fr;
  }

  .param-name {
    min-width: 0;
    display: block;
    margin-bottom: 2px;
  }
}
/* =========================
   CALLOUT BLOCKS — .note / .warning / .info

   Icons and labels are rendered entirely by CSS — no markup needed.
   Padding matches .section-note and .callout-* exactly (20px 24px)
   so all callout-style blocks are visually consistent.

   Technique:
     ::before  — display:block header row. The label text is the CSS
                 content value; the icon is a background-image on the
                 left, with padding-left clearing the icon width.
                 This single pseudo-element handles both icon and label
                 without any HTML changes.
========================= */

/* ── Shared structure ─────────────────────────────────── */
.note,
.warning,
.info {
  padding: 20px 24px;            /* identical to .section-note, .callout-* */
  border-radius: 8px;
  margin: 1.5em 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #4b5563;
}

.note p,
.warning p,
.info p {
  margin: 0 0 0.5em;
  font-size: inherit;
  color: inherit;
}
.note p:last-child,
.warning p:last-child,
.info p:last-child { margin-bottom: 0; }

/* Header row — block-level pseudo carries both the icon (background-image)
   and the label text (content). padding-left clears the 20px icon + 6px gap. */
.note::before,
.warning::before,
.info::before {
  display: block;
  padding-left: 28px;
  margin-bottom: 10px;
  min-height: 20px;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 20px 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 20px;
}


/* ── NOTE — brand purple (#903ea0) ───────────────────── */
.note {
  background-color: #fae6fd;
  border-left: 3px solid #903ea0;
}

.note::before {
  content: "NOTE";
  color: #903ea0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23903ea0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}


/* ── WARNING — "For Your Attention" — amber (#f59e0b) ── */
.warning {
  background-color: #fffbeb;
  border-left: 3px solid #f59e0b;
}

.warning::before {
  content: "FOR YOUR ATTENTION";
  color: #d97706;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}


/* ── INFO — cyan (#06b6d4) ───────────────────────────── */
.info {
  background-color: #ecfeff;
  border-left: 3px solid #06b6d4;
}

.info::before {
  content: "INFO";
  color: #0891b2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}


/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .note,
  .warning,
  .info {
    padding: 16px 18px;
  }
}


/* =========================
   VIDEO (Aligned with layout & spacing)
========================= */
video {
  width: 100%;
  max-width: 100%;
  border-radius: 10px; /* matches cards/accordion softness */
  margin: 1.5em 0;
  background-color: #000;
  display: block;
}

/* Add subtle frame like images/tables */
video {
  border: 1px solid #e5e7eb;
}

/* Better spacing when stacked with text */
video + p,
p + video {
  margin-top: 1em;
}

/* Responsive consistency */
@media (max-width: 768px) {
  video {
    border-radius: 8px;
  }

  .note {
    padding: 16px 18px;
  }
}