/* ================================================================
   NETSTUTS.COM — netstuts.css
   Unified stylesheet for ALL pages except index.html
   Replaces: body.css + cisco-lab-style.css + quizes.css
             + footers.css + configuration-footer.css
   ================================================================ */


/* ================================================================
   GOOGLE FONTS
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');


/* ================================================================
   CSS VARIABLES
================================================================ */

:root {
  /* Brand */
  --primary:          #2563eb;
  --primary-dark:     #1d4ed8;
  --brand-primary:    #1e40af;
  --brand-dark:       #0f172a;
  --brand-accent:     #1e3a8a;
  --brand-light:      #3b82f6;

  /* Cisco palette */
  --cisco-navy:       #1b4f72;
  --cisco-blue:       #1a6fa0;
  --cisco-teal:       #148f77;

  /* Surfaces */
  --bg-page:          #f3f6fb;
  --bg-card:          #ffffff;
  --bg-soft:          #f8fafc;
  --bg-highlight:     #eaf4fb;

  /* Text */
  --text-main:        #1f2937;
  --text-muted:       #4b5563;
  --text-light:       #6b7280;
  --text-link:        #1a6fa0;
  --text-link-hover:  #1b4f72;

  /* Borders */
  --border-soft:      #e5e7eb;
  --border-medium:    #d1d5db;
  --border-table:     #b8c4d0;
  --border:           #e2e8f0;

  /* Status */
  --success:          #10b981;
  --success-dark:     #00cc52;
  --success-green:    #00ff66;
  --warning-bg:       #fff7ed;
  --warning-border:   #f97316;
  --warning-text:     #7c2d12;
  --info-bg:          #f0f9ff;
  --info-border:      #0284c7;
  --info-text:        #075985;

  /* Shadows */
  --shadow-soft:      0 18px 40px rgba(0, 0, 0, 0.08);
  --shadow-medium:    0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-inner:     inset 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-table:     0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md:        0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.05);

  /* Radii */
  --radius-sm:        8px;
  --radius-md:        12px;
  --radius-lg:        14px;

  /* Transition */
  --transition:       0.2s ease;
}


/* ================================================================
   RESET & BASE
================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system,
               BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; margin: 14px 0; display: block; }


/* ================================================================
   LAYOUT
================================================================ */

.ad-wrapper   { min-height: 100vh; display: flex; flex-direction: column; }
.main-content { flex: 1; }
.wrapper      { width: 100%; }

.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 32px 28px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  position: relative;
}

/* Blue accent bar at top */
.container::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 4px; width: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}


/* ================================================================
   HEADINGS
================================================================ */

h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.025em;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 5px;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.35s ease;
}
h1:hover::after { width: 110px; }

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  margin: 24px 0 10px;
  padding-left: 28px;
  position: relative;
  display: inline-block;
}

h2::before {
  content: '◆';
  position: absolute;
  left: 0; top: 5px;
  color: var(--primary);
  font-size: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0;
  width: 0; height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
h2:hover::after { width: 100%; }

/* Block h2 (before quiz questions) */
.section h2,
.section > h2,
h2:has(+ .question),
h2:has(~ .question) {
  display: block;
  clear: both;
  width: 100%;
  padding-left: 36px;
}
.section h2::before,
.section > h2::before,
h2:has(+ .question)::before,
h2:has(~ .question)::before { left: 0; }

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cisco-blue);
  margin: 24px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h3::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 2px;
  background: var(--cisco-teal);
  flex-shrink: 0;
}

/* Override h3::before inside quiz questions (uses counter badge instead) */
.question h3::before { display: none; }


/* ================================================================
   PARAGRAPHS, LEAD & LISTS
================================================================ */

p {
  font-size: 1rem;
  margin: 14px 0 20px;
  color: var(--text-main);
  line-height: 1.75;
  max-width: 74ch;
}

p strong, b, strong { color: #020617; font-weight: 700; }

em { color: var(--cisco-blue); font-style: normal; font-weight: 500; }

/* Lead paragraph */
p.lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
  padding: 18px 22px;
  background: var(--info-bg);
  border-left: 4px solid var(--info-border);
  border-radius: var(--radius-sm);
  max-width: 100%;
}

ul {
  padding-left: 22px;
  margin: 14px 0 24px;
}
ul li {
  margin-bottom: 8px;
  color: var(--text-main);
  line-height: 1.6;
}

/* Spacing helpers */
.p-tight    { margin: 0 0 2px 0; }
.pre-tight  { margin-top: 2px; }
.terminal-label { margin-bottom: 6px; }


/* ================================================================
   LINKS
================================================================ */

a {
  color: var(--text-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 111, 160, 0.25);
  transition: color var(--transition), border-color var(--transition);
}

a:hover {
  color: var(--text-link-hover);
  border-bottom-color: var(--cisco-navy);
}


/* ================================================================
   SECTIONS
================================================================ */

section {
  margin: 30px 0;
  animation: slideIn 0.35s ease both;
}

section:nth-child(2)  { animation-delay: 0.04s; }
section:nth-child(3)  { animation-delay: 0.08s; }
section:nth-child(4)  { animation-delay: 0.12s; }
section:nth-child(5)  { animation-delay: 0.16s; }
section:nth-child(6)  { animation-delay: 0.20s; }
section:nth-child(7)  { animation-delay: 0.24s; }
section:nth-child(8)  { animation-delay: 0.28s; }
section:nth-child(9)  { animation-delay: 0.32s; }
section:nth-child(10) { animation-delay: 0.36s; }
section:nth-child(11) { animation-delay: 0.40s; }
section:nth-child(12) { animation-delay: 0.44s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  display: flow-root;
  clear: both;
}
.section:first-of-type { border-top: none; padding-top: 0; }


/* ================================================================
   INLINE CODE
================================================================ */

code {
  background: #f1f5f9;
  color: var(--brand-dark);
  padding: 3px 7px;
  border-radius: 5px;
  font-family: 'IBM Plex Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #e2e8f0;
}

/* Code inside quiz options — inline, wraps between words not within them */
.question code {
  white-space: normal;
  word-break: break-word;
  font-size: 0.9em;
  display: inline;
  vertical-align: baseline;
  color: var(--primary);
  background: #f1f5f9;
  border: 1px solid var(--border-soft);
}


/* ================================================================
   PRE BLOCKS — GENERIC
================================================================ */

pre {
  background: var(--bg-soft);
  border-left: 4px solid var(--brand-primary);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-family: 'IBM Plex Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 18px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-main);
  box-shadow: var(--shadow-inner);
}

pre:not(.cisco-terminal) {
  background: var(--bg-soft);
  color: var(--text-main);
  border-left: 4px solid var(--brand-primary);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-weight: 400;
  white-space: inherit;
  color: inherit;
}


/* ================================================================
   CISCO IOS TERMINAL — BLACK + GREEN (NEVER CHANGES IN ANY MODE)
================================================================ */

.cisco-terminal {
  background: #000000 !important;
  color: #00ff66 !important;
  padding: 18px 20px;
  border-radius: 10px;
  font-family: 'IBM Plex Mono', 'Consolas', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 22px 0 6px;
  border-left: 6px solid #00ff66 !important;
  box-shadow: inset 0 0 0 1px rgba(0, 255, 102, 0.25);
  white-space: pre;
  word-wrap: normal;
}

h2 + .cisco-terminal { margin-top: 0; }

.cisco-terminal::selection,
.cisco-terminal ::-moz-selection {
  background: rgba(0, 255, 102, 0.25);
  color: #00ff66;
}

/* Animated underline inside terminal */
.underline-wrap { display: inline-block; position: relative; }
.underline-text { color: #00ff66; font-weight: 600; position: relative; z-index: 2; }
.underline-wrap::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 0; height: 2px;
  background: #ffffff;
  animation: underline-anim 1s forwards;
  animation-delay: 0.5s;
  z-index: 1;
}
.cisco-terminal .underline-wrap::after { bottom: 0; }

@keyframes underline-anim {
  from { width: 0; }
  to   { width: 100%; }
}

/* Highlight box inside terminal */
.highlight-box {
  display: inline-block;
  border: 2px solid #ffffff;
  padding: 6px 8px;
  margin: 4px 0;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}


/* ================================================================
   CALLOUT BOXES
================================================================ */

.highlight {
  background: var(--info-bg);
  border-left: 5px solid var(--info-border);
  color: var(--info-text);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 22px 0;
  font-size: 0.97rem;
  line-height: 1.65;
}
.highlight strong { color: var(--info-text); }

.warning {
  background: var(--warning-bg);
  border-left: 6px solid var(--warning-border);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--warning-text);
  margin: 22px 0;
  box-shadow: var(--shadow-medium);
}
.warning strong { color: var(--warning-text); }

.best-practices {
  background: var(--info-bg);
  border-left: 6px solid var(--info-border);
  padding: 24px 26px;
  margin: 34px 0;
  border-radius: 10px;
  box-shadow: var(--shadow-medium);
}
.best-practices h2 {
  margin-top: 0;
  border: none;
  padding-left: 0;
  color: var(--info-text);
}

/* Caption under terminals / images */
.caption {
  margin-top: 6px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-style: italic;
  padding: 0 4px;
}

/* Related pages link bar */
section:first-of-type p:last-of-type {
  font-size: 0.88rem;
  color: var(--text-muted);
  background: #f0f7ff;
  border-left: 4px solid var(--brand-light);
  padding: 10px 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  max-width: 100%;
  margin-top: 12px;
}


/* ================================================================
   TABLES
================================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 30px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-table);
  border-radius: var(--radius-sm);
  overflow: hidden;
  table-layout: fixed;
  word-wrap: break-word;
}

table td code,
table th code {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

table th {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
}

table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-main);
  vertical-align: top;
  line-height: 1.55;
}

table td:first-child { font-weight: 500; }
table td b { color: #020617; }
table tr:nth-child(even) td { background: var(--bg-soft); }
table tr:hover td { background: #f1f5f9; }


/* ================================================================
   BACK TO HOME BUTTON
================================================================ */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  padding: 14px 40px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-accent));
  color: #ffffff;
  border-radius: 100px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: none;
  box-shadow: var(--shadow-medium);
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
  width: fit-content;
}

/* Ensure the parent <p> doesn't left-align the button */
p:has(> a.btn) {
  text-align: center;
}

.btn:hover {
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary));
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(30, 58, 138, 0.3);
  color: #fff;
  border-bottom: none;
}

.btn:active { transform: translateY(-1px); }
.btn svg { transition: transform var(--transition); }
.btn:hover svg { transform: translateX(-2px); }


/* ================================================================
   QUIZ — CONTAINER
================================================================ */

.container,
#quizForm,
#quiz-form,
form[id*="quiz"],
form[id*="Quiz"] {
  counter-reset: question-counter;
}

#quizForm,
#quiz-form {
  margin-top: 52px;
}


/* ================================================================
   QUIZ — QUESTION BLOCK
================================================================ */

.question {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.question::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
  opacity: 0.18;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  transition: opacity 0.22s ease;
}

.question:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}
.question:hover::before { opacity: 0.7; }


/* ================================================================
   QUIZ — QUESTION TITLE
================================================================ */

.question h3 {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  line-height: 1.65;
  word-break: break-word;
  padding-left: 44px;
  position: relative;
}

.question h3::before {
  counter-increment: question-counter;
  content: counter(question-counter) !important;
  position: absolute;
  left: 0; top: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  z-index: 2;
}


/* ================================================================
   QUIZ — OPTION LABELS
================================================================ */

.question label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease;
  user-select: none;
  border: 1.5px solid var(--border-soft);
  background: var(--bg-soft);
  line-height: 1.55;
  max-width: 100%;
  font-size: 0.97rem;
  color: var(--text-main);
}

.question label:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.question label:has(input:checked) {
  background: #eff6ff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.question input[type="radio"],
.question input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 3px;
  cursor: pointer;
}

.option-label {
  font-weight: 800;
  color: var(--primary);
  width: 22px;
  flex-shrink: 0;
  font-size: 0.9rem;
  margin-top: 1px;
}

.option-text {
  font-size: 1rem;
  color: var(--text-main);
  flex: 1;
  min-width: 0;          /* critical: allows flex child to shrink below content size */
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
}

.question input:checked + .option-text,
.question input:checked + span {
  font-weight: 600;
  color: var(--primary);
}


/* ================================================================
   QUIZ — ANSWER SUMMARY
================================================================ */

.answer-summary {
  display: none;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}


/* ================================================================
   QUIZ — EXPLANATION PANEL
================================================================ */

.explanation {
  display: none;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.97rem;
  line-height: 1.7;
  border-left: 5px solid;
  animation: fadeSlideIn 0.3s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.correct-answer {
  background: #f0fdf4;
  color: #14532d;
  border-color: #22c55e;
}
.correct-answer::after {
  content: '✓ Correct';
  display: inline-block;
  background: #22c55e;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 10px;
  letter-spacing: 0.02em;
}

.incorrect-answer {
  background: #fef2f2;
  color: #7f1d1d;
  border-color: #ef4444;
}
.incorrect-answer::after {
  content: '✗ Incorrect';
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 10px;
}

.unanswered-answer {
  background: #fffbeb;
  color: #78350f;
  border-color: #f59e0b;
}
.unanswered-answer::after {
  content: '— Not answered';
  display: inline-block;
  background: #f59e0b;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 10px;
}

.explanation b { color: #1e8449; }


/* ================================================================
   QUIZ — RESULT PANEL
================================================================ */

#result {
  margin-top: 44px;
  padding: 32px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  animation: fadeSlideIn 0.38s ease both;
}
#result h2 { color: var(--primary); font-size: 2rem; margin-bottom: 10px; font-weight: 800; }
#result .score {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  margin: 14px 0 8px;
  letter-spacing: -0.03em;
  line-height: 1;
}
#result .score-label { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0; }

/* Inner result div — replaces inline styles from quiz.js */
#result .result-inner {
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
  line-height: 1.6;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
}

.result-divider {
  margin: 12px 0;
  border: none;
  border-top: 1px solid var(--border-soft);
}

[data-theme="dark"] #result .result-inner {
  background: #1e2130 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] .result-divider { border-top-color: #2d3148 !important; }
[data-theme="dark"] #result .result-inner strong { color: #f1f5f9 !important; }


/* ================================================================
   QUIZ — BUTTONS
================================================================ */

.quiz-btn-wrapper {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.quiz-btn-wrapper button,
.retake-btn,
.quiz-action-btn {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 40px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.3px;
  min-width: 170px;
  line-height: 1.5;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  position: relative;
  overflow: hidden;
  font-family: 'IBM Plex Sans', sans-serif;
}

/* Show Answers — blue */
.quiz-btn-wrapper button:not(.retake-btn) {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}
.quiz-btn-wrapper button:not(.retake-btn):hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--brand-accent));
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
}
.quiz-btn-wrapper button:not(.retake-btn):active { transform: translateY(-1px); }

/* Re-Take Quiz — green */
.quiz-btn-wrapper .retake-btn,
.retake-btn {
  background: linear-gradient(135deg, var(--success), var(--success-dark)) !important;
  color: white !important;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.22);
  border: none;
}
.retake-btn:hover {
  background: linear-gradient(135deg, var(--success-dark), #00b350) !important;
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.3) !important;
}
.retake-btn:active { transform: translateY(-1px); }

/* Back to Home — identical style for both .btn and .quiz-action-btn */
.quiz-action-btn {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-accent));
  color: white;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.22);
}
.quiz-action-btn:hover {
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary));
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(30, 58, 138, 0.3);
}

/* ── Back to Home button — no hover effect ── */
.back-home a.quiz-action-btn:hover,
.back-home a.quiz-action-btn:focus {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-accent)) !important;
  transform: none !important;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.22) !important;
}
.quiz-action-btn:active { transform: translateY(-1px); }

/* Disabled */
.quiz-btn-wrapper button:disabled {
  background: #d1d5db !important;
  color: #9ca3af !important;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.back-home { text-align: center; margin-top: 24px; display: flex; justify-content: center; }

/* Center standalone quiz-action-btn outside .back-home wrapper */
p > a.quiz-action-btn,
div > a.quiz-action-btn {
  display: block;
  width: fit-content;
  margin: 20px auto 0;
  text-align: center;
}


/* ================================================================
   QUIZ — OPTION HIGHLIGHTING (after submit)
================================================================ */

.label-correct  { background: #f0fdf4 !important; border-color: #22c55e !important; }
.label-incorrect { background: #fef2f2 !important; border-color: #ef4444 !important; }
.question.answered::before { opacity: 0.5; background: #22c55e; }


/* ================================================================
   FOOTER
================================================================ */

#main-footer {
  display: flex !important;
  justify-content: center !important;
  margin-top: 30px !important;
  padding: 0 20px 14px !important;
  background: transparent !important;
  position: relative !important;
  box-sizing: border-box !important;
}

#main-footer .footer-inner {
  background: white !important;
  color: #1a1a1a !important;
  max-width: 800px !important;
  width: 100% !important;
  padding: 22px 36px !important;
  border-radius: 20px !important;
  text-align: center !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.5) inset !important;
  position: relative !important;
  overflow: hidden !important;
  margin: 0 auto !important;
  display: block !important;
}

#main-footer .footer-title {
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  margin-bottom: 16px !important;
  color: #1a1a1a !important;
  letter-spacing: 0.5px !important;
  position: relative !important;
  display: inline-block !important;
  padding: 0 15px !important;
  text-align: center !important;
}

#main-footer .footer-title::before {
  content: '✨' !important;
  position: absolute !important;
  left: -30px !important; top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 1rem !important;
  animation: sparkle 2s ease-in-out infinite !important;
}

#main-footer .footer-title::after {
  content: '✨' !important;
  position: absolute !important;
  right: -30px !important; top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 1rem !important;
  animation: sparkle 2s ease-in-out infinite !important;
  animation-delay: 1s !important;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50%       { opacity: 0.5; transform: translateY(-50%) scale(0.9); }
}

#main-footer .social-buttons {
  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 20px 0 25px !important;
  flex-wrap: wrap !important;
  position: relative !important;
}

/* Compact circle social buttons */
#main-footer .svg-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 50% !important;
  text-decoration: none !important;
  color: white !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15), 0 1px 0 rgba(255,255,255,0.1) inset !important;
  width: 38px !important;
  height: 38px !important;
  border: none !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer !important;
  margin: 0 !important;
}

#main-footer .social-icon {
  width: 18px !important;
  height: 18px !important;
  filter: brightness(0) invert(1) !important;
  transition: transform 0.3s ease !important;
}

#main-footer .svg-button.facebook { background: #3b5998 !important; }
#main-footer .svg-button.x        { background: #000000 !important; }
#main-footer .svg-button.whatsapp { background: #25d366 !important; }
#main-footer .svg-button.linkedin { background: #0077b5 !important; }

#main-footer .svg-button span,
#main-footer .svg-button .sr-only { display: none !important; }

#main-footer .sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; border: 0 !important;
}

#main-footer .svg-button::before {
  content: "" !important;
  position: absolute !important; inset: 0 !important;
  background: linear-gradient(120deg, rgba(255,255,255,0.35), rgba(255,255,255,0.05), rgba(255,255,255,0.35)) !important;
  opacity: 0 !important;
  transition: opacity 0.4s ease !important;
  z-index: 1 !important;
}
#main-footer .svg-button:hover::before { opacity: 1 !important; }
#main-footer .svg-button:hover {
  transform: translateY(-3px) scale(1.06) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35) !important;
}

#main-footer .footer-copy {
  color: #111827 !important;
  font-size: 0.9rem !important;
  margin-top: 18px !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(0,0,0,0.1) !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  line-height: 1.5 !important;
  text-align: center !important;
  display: block !important;
  width: 100% !important;
  clear: both !important;
}

#main-footer strong {
  color: #1e40af !important;
  font-weight: 700 !important;
  position: relative !important;
  display: inline-block !important;
}
#main-footer strong::after {
  content: '' !important;
  position: absolute !important;
  bottom: -2px !important; left: 0 !important;
  width: 100% !important; height: 3px !important;
  background: linear-gradient(90deg, #2563eb, transparent) !important;
  border-radius: 1.5px !important;
  transform: scaleX(0) !important;
  transition: transform 0.3s ease !important;
}
#main-footer strong:hover::after { transform: scaleX(1) !important; }

#main-footer * { box-sizing: border-box !important; }


/* ================================================================
   SCROLLBAR
================================================================ */

::-webkit-scrollbar           { width: 10px; height: 10px; }
::-webkit-scrollbar-track     { background: #f1f1f1; border-radius: 5px; }
::-webkit-scrollbar-thumb     { background: var(--brand-primary); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-accent); }


/* ================================================================
   SELECTION & FOCUS
================================================================ */

::selection      { background: rgba(30, 64, 175, 0.2); color: var(--text-main); }
::-moz-selection { background: rgba(30, 64, 175, 0.2); color: var(--text-main); }

:focus              { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }


/* ================================================================
   RESPONSIVE — 768px
================================================================ */

@media (max-width: 768px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.15rem; margin-top: 36px; padding-left: 12px; }
  h3 { font-size: 1rem; }
  p  { max-width: 100%; }

  .container { padding: 22px 16px; margin: 20px auto; border-radius: 8px; }

  .cisco-terminal, pre { padding: 14px 16px; font-size: 0.9rem; margin: 16px 0; }

  table { font-size: 0.875rem; display: block; overflow-x: auto;
          -webkit-overflow-scrolling: touch; }

  .best-practices, .warning { padding: 18px 20px; margin: 24px 0; }

  .btn { width: 100%; text-align: center; justify-content: center; }

  /* Quiz */
  .question { padding: 20px 18px; margin-bottom: 24px; }
  .question h3 { font-size: 1rem; padding-left: 38px; }
  .question h3::before { width: 27px; height: 27px; font-size: 0.76rem; }
  .option-text { font-size: 0.97rem; }
  .quiz-btn-wrapper { flex-direction: column; align-items: center; gap: 12px; }
  .quiz-btn-wrapper button, .retake-btn, .quiz-action-btn {
    width: 100%; max-width: 300px; padding: 12px 28px;
    font-size: 0.98rem; min-width: unset;
  }
  #result .score { font-size: 2.4rem; }

  /* Footer */
  #main-footer .social-buttons { gap: 6px !important; margin: 15px 0 20px !important; }
  #main-footer .svg-button { width: 34px !important; height: 34px !important; }
  #main-footer .social-icon { width: 16px !important; height: 16px !important; }
  #main-footer .footer-title::before,
  #main-footer .footer-title::after { display: none !important; }
}


/* ================================================================
   RESPONSIVE — 480px
================================================================ */

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.15rem; }
  body { font-size: 0.95rem; line-height: 1.6; }
  .container { padding: 16px 12px; margin: 10px; }
  .question { padding: 16px 14px; }
  .question label { padding: 11px 12px; gap: 10px; }
  .explanation { padding: 14px 16px; font-size: 0.93rem; }
}


/* ================================================================
   PRINT
================================================================ */

@media print {
  body { background: white; color: black; font-size: 12pt; }
  .container { box-shadow: none; border: 1px solid #ddd; margin: 0; padding: 20px; }
  .quiz-btn-wrapper, .back-home, .social-buttons, #main-footer { display: none !important; }
  a { color: black; text-decoration: underline; }
  .cisco-terminal {
    background: white !important;
    color: black !important;
    border: 1px solid #ccc !important;
    border-left: 6px solid #333 !important;
  }
}


/* ================================================================
   DARK MODE
   Activated by: <html data-theme="dark">
================================================================ */

/* ── Variable overrides ── */
[data-theme="dark"] {
  --primary:       #60a5fa;
  --primary-dark:  #3b82f6;
  --brand-primary: #3b82f6;
  --brand-dark:    #e2e8f0;
  --brand-accent:  #60a5fa;
  --brand-light:   #93c5fd;
  --bg-page:       #0f1117;
  --bg-card:       #1a1d27;
  --bg-soft:       #161820;
  --bg-highlight:  #1e2a3a;
  --text-main:     #e2e8f0;
  --text-muted:    #9ca3af;
  --text-light:    #6b7280;
  --text-link:     #60a5fa;
  --text-link-hover: #93c5fd;
  --border-soft:   #2d3148;
  --border-medium: #374151;
  --border-table:  #374151;
  --border:        #2d3148;
  --cisco-navy:    #60a5fa;
  --cisco-blue:    #7dd3fc;
  --cisco-teal:    #34d399;
  --warning-bg:    #1c1408;
  --warning-border:#f97316;
  --warning-text:  #fdba74;
  --info-bg:       #0c1a2e;
  --info-border:   #3b82f6;
  --info-text:     #93c5fd;
}

/* ── Page & container ── */
[data-theme="dark"] body      { background: #0f1117; color: #e2e8f0; }
[data-theme="dark"] .container { background: #1a1d27; box-shadow: 0 18px 40px rgba(0,0,0,0.5); }
[data-theme="dark"] .section   { border-top-color: #2d3148; }

/* ── Headings ── */
[data-theme="dark"] h1,
[data-theme="dark"] h2         { color: #60a5fa; }
[data-theme="dark"] h2::before { color: #60a5fa; }
[data-theme="dark"] h3         { color: #7dd3fc; }
[data-theme="dark"] h3::before { background: #34d399; }

/* ── Body text ── */
[data-theme="dark"] p              { color: #e2e8f0; }
[data-theme="dark"] p strong,
[data-theme="dark"] b,
[data-theme="dark"] strong         { color: #f1f5f9; }
[data-theme="dark"] em             { color: #7dd3fc; }
[data-theme="dark"] p.lead         { background: #0c1a2e; border-left-color: #3b82f6; color: #93c5fd; }
[data-theme="dark"] ul li          { color: #e2e8f0; }
[data-theme="dark"] .caption       { color: #9ca3af !important; border-left-color: #374151; }

/* ── Links ── */
[data-theme="dark"] a       { color: #60a5fa; border-bottom-color: rgba(96,165,250,0.25); }
[data-theme="dark"] a:hover { color: #93c5fd; border-bottom-color: #93c5fd; }

/* ── Related pages bar ── */
[data-theme="dark"] section:first-of-type p:last-of-type {
  background: #0c1a2e;
  border-left-color: #93c5fd;
  color: #9ca3af;
}

/* ── Code ── */
[data-theme="dark"] code { background: #252838; color: #93c5fd; border-color: #374151; }

/* ── Pre blocks — !important beats hardcoded inline styles ── */
[data-theme="dark"] pre,
[data-theme="dark"] pre:not(.cisco-terminal) {
  background: #161820 !important;
  color: #e2e8f0 !important;
  border-color: #2d3148 !important;
  border-left-color: #3b82f6 !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* ── Cisco terminal — ALWAYS black+green, never changes ── */
[data-theme="dark"] .cisco-terminal {
  background: #000000 !important;
  color: #00ff66 !important;
  border-left-color: #00ff66 !important;
  box-shadow: inset 0 0 0 1px rgba(0,255,102,0.25) !important;
}

/* ── Tables ── */
[data-theme="dark"] table td             { color: #e2e8f0; border-bottom-color: #2d3148; }
[data-theme="dark"] table tr:nth-child(even) td { background: #1e2130; }
[data-theme="dark"] table tr:hover td    { background: #252838; }
[data-theme="dark"] table td b           { color: #f1f5f9; }

/* ── Callout boxes ── */
[data-theme="dark"] .highlight         { background: #0c1a2e; border-left-color: #3b82f6; color: #93c5fd; }
[data-theme="dark"] .highlight strong  { color: #93c5fd; }
[data-theme="dark"] .warning           { background: #1c1408; color: #fdba74; border-left-color: #f97316; }
[data-theme="dark"] .warning strong    { color: #fdba74; }
[data-theme="dark"] .best-practices    { background: #0c1a2e; border-left-color: #3b82f6; color: #93c5fd; }
[data-theme="dark"] .best-practices h2 { color: #93c5fd; }

/* ── Quiz questions ── */
[data-theme="dark"] .question             { background: #1a1d27; border-color: #2d3148; }
[data-theme="dark"] .question h3          { color: #60a5fa; }
[data-theme="dark"] .question code        { background: #252838; color: #93c5fd; border-color: #374151; }
[data-theme="dark"] .question label       { background: #1e2130; border-color: #2d3148; color: #e2e8f0; }
[data-theme="dark"] .question label:hover { background: #1e2a3a; border-color: #3b82f6; }
[data-theme="dark"] .question label:has(input:checked) { background: #1e2a3a; border-color: #60a5fa; }
[data-theme="dark"] .option-label         { color: #60a5fa; }
[data-theme="dark"] .option-text          { color: #e2e8f0; }
[data-theme="dark"] .question input:checked + .option-text,
[data-theme="dark"] .question input:checked + span { color: #60a5fa; }

/* ── Quiz results & explanations ── */
/* Override inline styles injected by quiz.js into #result */
[data-theme="dark"] #result div {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] #result strong { color: #f1f5f9 !important; }
[data-theme="dark"] #result hr { border-color: #2d3148 !important; }
[data-theme="dark"] #result               { background: #1a1d27 !important; border-color: #2d3148 !important; color: #e2e8f0 !important; }
[data-theme="dark"] .correct-answer       { background: #052e16; color: #86efac; border-color: #16a34a; }
[data-theme="dark"] .incorrect-answer     { background: #2d0a0a; color: #fca5a5; border-color: #dc2626; }
[data-theme="dark"] .unanswered-answer    { background: #1c1408; color: #fcd34d; border-color: #d97706; }
[data-theme="dark"] .label-correct        { background: #052e16 !important; border-color: #16a34a !important; }

/* ── Quiz history panel (injected by quiz.js) ── */
/* Table header row — was bright blue on dark, low contrast */
[data-theme="dark"] #quiz-history-panel table thead tr {
  background: #1e2130 !important;
}
[data-theme="dark"] #quiz-history-panel table thead th {
  color: #9ca3af !important;
  background: #1e2130 !important;
}
/* Table rows */
[data-theme="dark"] #quiz-history-panel table tbody tr {
  border-bottom-color: #2d3148 !important;
}
[data-theme="dark"] #quiz-history-panel table tbody td {
  background: #1a1d27 !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] #quiz-history-panel table tbody tr:nth-child(even) td {
  background: #1e2130 !important;
}
/* History panel wrapper */
[data-theme="dark"] #quiz-history-panel {
  border-color: #2d3148 !important;
}
[data-theme="dark"] #quiz-history-panel > div:last-child {
  background: #1a1d27 !important;
}
/* Satisfaction rating panel */
[data-theme="dark"] #quiz-satisfaction-panel {
  background: #1a1d27 !important;
  border-color: #2d3148 !important;
}
[data-theme="dark"] #quiz-satisfaction-panel p {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .sat-btn div {
  color: #9ca3af !important;
}
[data-theme="dark"] .label-incorrect      { background: #2d0a0a !important; border-color: #dc2626 !important; }

/* ── Quiz buttons ── */
[data-theme="dark"] .quiz-btn-wrapper button:not(.retake-btn) {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 8px 20px rgba(59,130,246,0.3);
}
[data-theme="dark"] .quiz-btn-wrapper .retake-btn,
[data-theme="dark"] .retake-btn {
  background: linear-gradient(135deg, #059669, #047857) !important;
  color: #fff !important;
}
[data-theme="dark"] .quiz-action-btn {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
}

/* ── Footer ── */
[data-theme="dark"] #main-footer .footer-inner {
  background: #1a1d27 !important;
  border-color: rgba(255,255,255,0.07) !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important;
  color: #e2e8f0 !important;
}
[data-theme="dark"] #main-footer .footer-title { color: #e2e8f0 !important; }
[data-theme="dark"] #main-footer .footer-copy  { color: #9ca3af !important; border-top-color: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] #main-footer strong        { color: #60a5fa !important; }


/* ============================================================
   netstuts-darkmode-v1
   Comprehensive dark-mode overrides for ALL pages.
   Appended automatically by fix_netstuts_css.py
   ============================================================ */

/* ── Page shell ─────────────────────────────────────────────── */
body.dark-mode {
  background-color: #0f1117 !important;
  color:            #e2e8f0 !important;
}

body.dark-mode .wrapper,
body.dark-mode .container,
body.dark-mode .main-content {
  background-color: #0f1117 !important;
  color:            #e2e8f0 !important;
}

/* ── Typography ─────────────────────────────────────────────── */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #93c5fd !important;
}

body.dark-mode p,
body.dark-mode li,
body.dark-mode dt,
body.dark-mode dd {
  color: #cbd5e1 !important;
}

body.dark-mode strong,
body.dark-mode b {
  color: #e2e8f0 !important;
}

body.dark-mode em,
body.dark-mode i {
  color: #cbd5e1 !important;
}

body.dark-mode a {
  color: #60a5fa !important;
}

body.dark-mode a:hover {
  color: #93c5fd !important;
}

/* ── Code & pre blocks ──────────────────────────────────────── */
body.dark-mode pre,
body.dark-mode .cisco-terminal,
body.dark-mode .diagram {
  background-color: #0d1117 !important;
  color:            #00ff66 !important;
  border-color:     #334155 !important;
  overflow-x:       auto    !important;
  white-space:      pre     !important;
}

body.dark-mode code {
  background-color: #252838 !important;
  color:            #93c5fd !important;
}

body.dark-mode pre code {
  background-color: transparent !important;
  color:            #00ff66    !important;
  white-space:      pre        !important;
}

/* ── Tables ─────────────────────────────────────────────────── */
body.dark-mode table {
  background-color: #1a2035 !important;
  color:            #e2e8f0 !important;
  border-color:     #334155 !important;
  overflow-x:       auto    !important;
  display:          block   !important;
  max-width:        100%    !important;
}

body.dark-mode th {
  background-color: #1e3a5f !important;
  color:            #93c5fd !important;
  border-color:     #334155 !important;
}

body.dark-mode td {
  background-color: #1a2035 !important;
  color:            #e2e8f0 !important;
  border-color:     #334155 !important;
}

body.dark-mode tr:nth-child(even) td {
  background-color: #1e2a45 !important;
}

body.dark-mode caption {
  color: #94a3b8 !important;
}

/* ── Callout boxes ──────────────────────────────────────────── */
body.dark-mode .note {
  background-color: #0c1f3a !important;
  color:            #93c5fd !important;
  border-left-color: #3b82f6 !important;
}

body.dark-mode .tip {
  background-color: #0f2d1f !important;
  color:            #6ee7b7 !important;
  border-left-color: #10b981 !important;
}

body.dark-mode .warning {
  background-color: #1c1408 !important;
  color:            #fbbf24 !important;
  border-left-color: #f59e0b !important;
}

body.dark-mode .highlight-box,
body.dark-mode .best-practices {
  background-color: #1a2035 !important;
  color:            #e2e8f0 !important;
  border-color:     #334155 !important;
}

body.dark-mode .highlight {
  background-color: #854d0e !important;
  color:            #fef3c7 !important;
}

body.dark-mode mark {
  background-color: #854d0e !important;
  color:            #fef3c7 !important;
}

body.dark-mode .example-block {
  background-color: #1a2035 !important;
  color:            #e2e8f0 !important;
  border-color:     #334155 !important;
}

/* ── Quiz & question elements ───────────────────────────────── */
body.dark-mode .question {
  background-color: #1a2035 !important;
  color:            #e2e8f0 !important;
  border-color:     #334155 !important;
}

body.dark-mode .question h3,
body.dark-mode .question h3 * {
  color: #93c5fd !important;
}

body.dark-mode .question label {
  background-color: #1e2a45 !important;
  color:            #cbd5e1 !important;
  border-color:     #334155 !important;
}

body.dark-mode .question label:hover {
  background-color: #263450 !important;
}

body.dark-mode .question label:has(input:checked),
body.dark-mode .question input:checked + .option-text,
body.dark-mode .question input:checked + span {
  background-color: #1e3a5f !important;
  color:            #93c5fd !important;
}

body.dark-mode .option-text,
body.dark-mode .option-label {
  color: #cbd5e1 !important;
}

body.dark-mode .explanation {
  background-color: #1a2035 !important;
  color:            #cbd5e1 !important;
  border-color:     #334155 !important;
}

body.dark-mode .answer-summary {
  background-color: #1a2035 !important;
  color:            #e2e8f0 !important;
}

body.dark-mode #result,
body.dark-mode #result h2,
body.dark-mode .result-inner {
  background-color: #1a2035 !important;
  color:            #e2e8f0 !important;
}

body.dark-mode #result .score {
  color: #4ade80 !important;
}

body.dark-mode #result .score-label {
  color: #94a3b8 !important;
}

body.dark-mode .correct-answer {
  background-color: #0f2d1f !important;
  color:            #6ee7b7 !important;
  border-color:     #10b981 !important;
}

body.dark-mode .incorrect-answer {
  background-color: #2d0f0f !important;
  color:            #fca5a5 !important;
  border-color:     #ef4444 !important;
}

body.dark-mode .unanswered-answer {
  background-color: #1a2035 !important;
  color:            #94a3b8 !important;
  border-color:     #334155 !important;
}

/* ── Section wrapper ────────────────────────────────────────── */
body.dark-mode .section {
  background-color: #141824 !important;
  border-color:     #334155 !important;
}

/* ── Caption / label text ───────────────────────────────────── */
body.dark-mode .caption {
  color: #94a3b8 !important;
}

/* ── Back home button ───────────────────────────────────────── */
body.dark-mode .back-home {
  background-color: #1e3a5f !important;
  color:            #93c5fd !important;
  border-color:     #334155 !important;
}

/* body.dark-mode .back-home:hover — removed to prevent hover background */
body.dark-mode .back-home:hover {
  background-color: transparent !important;
  background:       none        !important;
}

/* ── Input / radio / checkbox ───────────────────────────────── */
body.dark-mode input[type="radio"],
body.dark-mode input[type="checkbox"] {
  accent-color: #3b82f6 !important;
}

/* ── Scrollbars ─────────────────────────────────────────────── */
body.dark-mode ::-webkit-scrollbar {
  width:  8px;
  height: 8px;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: #1a2035;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background:    #334155;
  border-radius: 4px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #4b6080;
}

/* ── Global overflow / wrapping fixes (all modes) ───────────── */
pre {
  overflow-x: auto    !important;
  white-space: pre    !important;
  word-break:  normal !important;
  max-width:   100%   !important;
}

code {
  word-break:    break-word  !important;
  overflow-wrap: break-word  !important;
}

pre code {
  word-break:    normal !important;
  overflow-wrap: normal !important;
  white-space:   pre    !important;
}

table {
  display:    block   !important;
  overflow-x: auto    !important;
  max-width:  100%    !important;
}

img, video, iframe, embed, object {
  max-width: 100% !important;
  height:    auto !important;
}

/* ── sr-only utility (screen-reader only) ───────────────────── */
.sr-only {
  position:   absolute    !important;
  width:       1px        !important;
  height:      1px        !important;
  padding:     0          !important;
  margin:     -1px        !important;
  overflow:    hidden     !important;
  clip:        rect(0,0,0,0) !important;
  white-space: nowrap     !important;
  border:      0          !important;
}


/* netstuts-darkmode-v1-patch */
body.dark-mode .question label,
body.dark-mode .question label * {
  background-color: #1e2a45 !important;
  color:            #cbd5e1 !important;
  border-color:     #334155 !important;
}

body.dark-mode #main-footer .footer-inner {
  background-color: #141824 !important;
  border-color:     #334155 !important;
}

body.dark-mode #main-footer .footer-copy,
body.dark-mode #main-footer .footer-copy * {
  color: #94a3b8 !important;
}


/* netstuts-darkmode-v1-patch2 */
/* Quiz labels — higher specificity override for dark mode */
body.dark-mode #quizForm .question label,
body.dark-mode #quiz-form .question label,
body.dark-mode form .question label,
body.dark-mode .question label {
  background-color: #1e2a45 !important;
  color:            #cbd5e1 !important;
  border-color:     #334155 !important;
}

body.dark-mode #quizForm .question label:hover,
body.dark-mode .question label:hover {
  background-color: #263450 !important;
}

body.dark-mode #quizForm .question label:has(input:checked),
body.dark-mode .question label:has(input:checked) {
  background-color: #1e3a5f !important;
  color:            #93c5fd !important;
}

body.dark-mode .question .option-text,
body.dark-mode .question .option-label,
body.dark-mode .question label span {
  color: #cbd5e1 !important;
}

body.dark-mode .question code {
  background-color: #252838 !important;
  color:            #93c5fd !important;
}


/* netstuts-darkmode-v1-cssvars
   Override all CSS custom properties for dark mode.
   This is the root-cause fix — any element using these vars
   automatically gets the correct dark value. */
body.dark-mode {
  /* Page backgrounds */
  --bg-page:          #0f1117 !important;
  --bg-card:          #141824 !important;
  --bg-soft:          #1e2a45 !important;

  /* Text colours */
  --text-main:        #e2e8f0 !important;
  --text-muted:       #94a3b8 !important;
  --text-light:       #64748b !important;

  /* Borders */
  --border:           #334155 !important;
  --border-light:     #1e293b !important;

  /* Brand / accent (keep readable on dark) */
  --primary:          #3b82f6 !important;
  --primary-dark:     #2563eb !important;
  --brand-light:      #60a5fa !important;

  /* Status colours */
  --success:          #4ade80 !important;
  --warning-bg:       #1c1408 !important;
  --warning-border:   #f59e0b !important;
  --warning-text:     #fbbf24 !important;
  --info-bg:          #0c1f3a !important;
  --info-border:      #3b82f6 !important;
  --info-text:        #93c5fd !important;
}


/* netstuts-backhome-v1
   Back to Home button — centered, no background highlight */

/* ── Wrapper used on some pages (what-is-network, etc.) ─────── */
.back-home {
  display:         flex        !important;
  justify-content: center      !important;
  align-items:     center      !important;
  background:      none        !important;
  background-color: transparent !important;
  box-shadow:      none        !important;
  border:          none        !important;
  padding:         20px 0      !important;
  margin:          0           !important;
  width:           100%        !important;
}

/* ── Parent <p> tag used on most pages (lan, ospf, vlans…) ──── */
p:has(> a.btn) {
  display:         flex        !important;
  justify-content: center      !important;
  align-items:     center      !important;
  margin:          0           !important;
  padding:         0           !important;
  background:      none        !important;
}

/* ── The .btn anchor itself ─────────────────────────────────── */
a.btn {
  display:         inline-flex !important;
  margin-left:     auto        !important;
  margin-right:    auto        !important;
}

/* ── Dark mode — keep wrapper transparent ───────────────────── */
body.dark-mode .back-home {
  background:       none        !important;
  background-color: transparent !important;
  box-shadow:       none        !important;
}
