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

:root {
  --primary: #003a75;
  --accent: #f59e0b;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #0f172a;
  --text-light: #475569;
  --border: #e5e7eb;
  --warn-bg: #fff4e5;
  --warn-border: #f59e0b;
  --info-bg: #e0f2fe;
  --info-border: #0284c7;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --sidebar-w: 280px;
}

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

body {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0 24px;
  z-index: 10;
}

.sidebar .brand {
  font-size: 18px;
  font-weight: 700;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .brand-logo {
  height: 56px;
  width: auto;
  border-radius: 6px;
  cursor: pointer;
}

.sidebar h2 {
  font-size: 12px;
  padding: 0 16px;
  margin: 18px 0 6px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: background 0.15s ease;
}

.sidebar a.sub { padding-left: 32px; font-size: 13px; color: var(--text-light); }
.sidebar a:hover, .sidebar a.active { background: #e6f0ff; border-left-color: var(--primary); }

.sidebar .divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 16px 8px;
}

/* Main content */
.main { margin-left: var(--sidebar-w); padding: 32px 48px 80px; max-width: 980px; }

/* Student config bar */
.student-bar {
  background: linear-gradient(90deg, #e6f0ff, #fef3c7);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.student-bar label { font-weight: 600; }
.student-bar input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  width: 180px;
}
.student-bar button {
  padding: 6px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.student-bar button:hover { opacity: 0.9; }
.student-bar button.ghost {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
}
.student-bar button.ghost:hover { border-color: var(--primary); color: var(--primary); }
.student-bar .current { margin-left: auto; font-size: 13px; color: var(--text-light); }
.student-bar .current b { color: var(--primary); }

/* Progress bar */
.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 24px;
}
.progress-track {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.2s ease;
}
.progress-label { font-size: 12px; color: var(--text-light); min-width: 110px; text-align: right; }

/* Sections */
section { display: none; }
section.active { display: block; }

section h1 {
  font-size: 30px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
section h2 { font-size: 22px; margin: 24px 0 10px; }
section h2.step {
  margin-top: 40px;
  padding: 12px 16px;
  background: #f0f5ff;
  border-left: 4px solid var(--primary);
  border-radius: 0 6px 6px 0;
  color: var(--primary);
}
section h3 { font-size: 17px; margin: 18px 0 8px; }
section p, section li { margin-bottom: 8px; }
section ul, section ol { padding-left: 24px; margin-bottom: 16px; }

section table { border-collapse: collapse; width: 100%; margin: 16px 0; background: var(--surface); }
section th, section td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; font-size: 14px; }
section th { background: #f9fafb; font-weight: 600; }
section img { max-width: 100%; height: auto; border-radius: 8px; }

.image-zoom img {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  margin-bottom: 24px;
}
.image-zoom:hover img { box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12); }

/* Image modal */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}
.image-modal.open {
  visibility: visible;
  pointer-events: auto;
}
.image-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  transition: background 0.4s ease;
}
.image-modal.open .image-modal-overlay {
  background: rgba(15, 23, 42, 0.6);
}
.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: transparent;
  padding: 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-60vw, -60vh) scale(0.1);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.image-modal.open .image-modal-content {
  transform: translate(0, 0) scale(1);
  opacity: 1;
}
.image-modal.closing .image-modal-overlay {
  background: rgba(15, 23, 42, 0);
}
.image-modal.closing .image-modal-content {
  transform: translate(-60vw, -60vh) scale(0.1);
  opacity: 0;
}
.image-modal-content img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}
.image-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.image-modal-close:hover { background: rgba(255,255,255,0.15); }

/* Draft indicator dot */
.draft-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

/* Region color badges */
.region-central {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
}
.region-west {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
}
.route-arrow {
  display: inline-block;
  font-size: 16px;
  color: var(--text-light);
  vertical-align: middle;
  padding: 0 4px;
}

/* Code blocks */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 13px;
  position: relative;
}
code { font-family: "IBM Plex Mono", Menlo, Consolas, monospace; font-size: 13px; }
p code, li code, td code { background: #eef2ff; padding: 2px 6px; border-radius: 4px; color: var(--text); }

.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.domain-badge.pending { color: #b91c1c; background: #fee2e2; padding: 2px 8px; border-radius: 6px; }
.domain-badge.ready { color: #166534; background: #dcfce7; padding: 2px 8px; border-radius: 6px; }
.domain-badge .icon { font-size: 12px; }

/* Copy button */
pre .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 11px;
  background: #1f2937;
  color: #d1d5db;
  border: 1px solid #374151;
  border-radius: 4px;
  cursor: pointer;
}
pre .copy-btn:hover { background: #374151; color: #fff; }

/* Admonition */
.admonition { padding: 12px 16px; border-radius: 8px; margin: 16px 0; border-left: 5px solid; }
.admonition.warning { background: var(--warn-bg); border-color: var(--warn-border); }
.admonition.info { background: var(--info-bg); border-color: var(--info-border); }
.admonition strong { display: block; margin-bottom: 4px; }
.admonition ul { margin-top: 8px; padding-left: 18px; }
.admonition li { margin-top: 6px; }
.admonition .note { margin-top: 10px; color: var(--text-light); }

/* Platform headings */
.platform-heading {
  font-size: 19px;
  font-weight: 700;
  margin: 12px 0 8px;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
}
.platform-heading.linux {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #1e40af;
}
.platform-heading.linux::before { content: "🐧\00a0"; }
.platform-heading.mac {
  background: #dcfce7;
  color: #166534;
  border-left: 4px solid #166534;
  margin-top: 32px;
}
.platform-heading.mac::before { content: "🍏\00a0"; }

/* Tech doc reference */
.tech-doc-ref {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  margin: 8px 0;
}
.tech-doc-ref a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.tech-doc-ref a:hover { text-decoration: underline; }

/* Test access link */
.test-access {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #e0f2fe, #f0f5ff);
  border: 2px solid var(--primary);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  margin: 6px 0;
}
.test-access:hover {
  background: linear-gradient(135deg, #bae6fd, #dbeafe);
  box-shadow: 0 2px 8px rgba(0, 58, 117, 0.15);
}
.test-access .arrow { font-size: 18px; }

/* Test button row */
.test-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
}
.test-row .test-access { margin: 0; min-width: 420px; }

.test-waf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #fee2e2, #fef2f2);
  border: 2px solid #dc2626;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.test-waf:hover {
  background: linear-gradient(135deg, #fecaca, #fee2e2);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

/* Section navigation */
.section-nav {
  display: none;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 32px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(243,244,246,0) 0%, rgba(243,244,246,0.95) 40%, rgba(243,244,246,0.98) 100%);
  padding: 12px 0 8px;
}
.section-nav button {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.section-nav button:hover { border-color: var(--primary); color: var(--primary); }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
}
