@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0f1117;
  --bg2: #161b27;
  --bg3: #1e2536;
  --bg4: #252d42;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.15);
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #2496ed;
  --accent2: #4db8ff;
  --accent3: #f5c06c;
  --accent4: #e27d76;
  --accent5: #6c8ef5;
  --accent6: #4fd1a5;
  --accent-k8s: #326ce5;
  --accent-k8s2: #5b8cf7;
  --code-bg: #0d1117;
  --tag-bg: rgba(36,150,237,0.12);
  --tag-text: #4db8ff;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 268px;
  min-width: 268px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 0 40px;
  flex-shrink: 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.logo-icon {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.logo-pip {
  width: 10px; height: 10px; border-radius: 50%;
}
.logo-pip.docker { background: var(--accent); }
.logo-pip.k8s    { background: var(--accent-k8s); }
.logo-pip.sre    { background: var(--accent6); }

.logo-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.logo-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav-section { margin-bottom: 4px; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 20px 4px;
}
.nav-label.docker-label { color: rgba(36,150,237,0.7); }
.nav-label.k8s-label    { color: rgba(50,108,229,0.8); }

.nav-link {
  display: block;
  padding: 6px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--accent2); border-left-color: var(--accent); background: rgba(36,150,237,0.06); }

/* ── MAIN ── */
.main {
  flex: 1;
  max-width: 980px;
  padding: 40px 52px 100px;
  overflow-x: hidden;
}

section { margin-bottom: 64px; scroll-margin-top: 24px; }

h1 { font-size: 28px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
h2 {
  font-size: 20px; font-weight: 600; color: var(--text);
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 26px 0 10px; }
h4 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin: 20px 0 8px; }

p { color: var(--muted); margin-bottom: 10px; line-height: 1.7; font-size: 14px; }
p strong { color: var(--text); font-weight: 500; }
a { color: var(--accent5); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, rgba(36,150,237,0.09) 0%, rgba(50,108,229,0.06) 100%);
  border: 1px solid rgba(36,150,237,0.22);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(36,150,237,0.12), transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: 24px; margin-bottom: 6px; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ── BADGES ── */
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-blue   { background: rgba(36,150,237,0.15);  color: #4db8ff; border: 1px solid rgba(36,150,237,0.25); }
.badge-k8s    { background: rgba(50,108,229,0.15);  color: #7da4f7; border: 1px solid rgba(50,108,229,0.25); }
.badge-green  { background: rgba(79,209,165,0.12);  color: #5dd1a0; border: 1px solid rgba(79,209,165,0.2); }
.badge-amber  { background: rgba(245,192,108,0.12); color: #f5c06c; border: 1px solid rgba(245,192,108,0.2); }
.badge-red    { background: rgba(226,125,118,0.12); color: #e27d76; border: 1px solid rgba(226,125,118,0.2); }
.badge-purple { background: rgba(108,142,245,0.12); color: #8fadf7; border: 1px solid rgba(108,142,245,0.2); }

/* ── MODULE HEADER STRIPS ── */
.module-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid;
}
.module-banner.docker {
  background: rgba(36,150,237,0.07);
  border-color: rgba(36,150,237,0.2);
}
.module-banner.k8s {
  background: rgba(50,108,229,0.07);
  border-color: rgba(50,108,229,0.2);
}
.module-banner-num {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 6px;
  white-space: nowrap;
}
.docker .module-banner-num { background: rgba(36,150,237,0.18); color: var(--accent2); }
.k8s   .module-banner-num { background: rgba(50,108,229,0.18); color: var(--accent-k8s2); }
.module-banner-title { font-size: 14px; font-weight: 600; color: var(--text); }
.module-banner-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── CODE ── */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 12px 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}
pre::-webkit-scrollbar { height: 4px; }
pre::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent6);
}
pre code { background: none; padding: 0; border-radius: 0; color: inherit; font-size: 12.5px; }

/* Syntax colors */
.comment { color: #5a6474; font-style: italic; }
.kw  { color: #c678dd; }
.str { color: #98c379; }
.num { color: #d19a66; }
.fn  { color: #61afef; }
.flag { color: #e5c07b; }
.var  { color: #56b6c2; }
.cmd  { color: #4db8ff; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; margin: 14px 0; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 14px;
  background: var(--bg3);
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.55;
}
td:first-child { font-family: var(--mono); font-size: 12px; color: #4db8ff; white-space: pre; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

/* Wide tables — allow command column to wrap */
.table-wrap.wide td:first-child { white-space: normal; }

/* ── CALLOUTS ── */
.callout {
  display: flex; gap: 12px;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.65;
}
.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-body { color: var(--muted); }
.callout-body strong { color: var(--text); }
.callout.tip    { background: rgba(79,209,165,0.07);  border: 1px solid rgba(79,209,165,0.2); }
.callout.warn   { background: rgba(245,192,108,0.07); border: 1px solid rgba(245,192,108,0.2); }
.callout.info   { background: rgba(108,142,245,0.07); border: 1px solid rgba(108,142,245,0.2); }
.callout.danger { background: rgba(226,125,118,0.08); border: 1px solid rgba(226,125,118,0.22); }

/* ── SCENARIO CARDS (inline "when to use") ── */
.scenario {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.55;
}
.scenario strong { color: var(--accent3); font-style: normal; }

/* ── DIVIDER ── */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── FLOATING ACTIONS ── */
.floating-actions {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}
.floating-link,
.floating-button {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}
.floating-link:hover,
.floating-button:hover {
  background: var(--bg4);
  color: var(--text);
  border-color: var(--accent2);
}
.floating-link svg,
.floating-button svg { width: 18px; height: 18px; }
.floating-button { background: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Theme toggle icon switching */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: block; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg2: #ffffff;
  --bg3: #eef1f8;
  --bg4: #e4e8f4;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.14);
  --text: #1a1d27;
  --muted: #5a6278;
  --code-bg: #f0f2f8;
  --tag-bg: rgba(36,150,237,0.1);
  --tag-text: #1a76be;
}
[data-theme="light"] td:first-child { color: #1676c8; }
[data-theme="light"] .callout.tip    { background: rgba(21,168,103,0.06); border-color: rgba(21,168,103,0.2); }
[data-theme="light"] .callout.warn   { background: rgba(196,140,22,0.07); border-color: rgba(196,140,22,0.22); }
[data-theme="light"] .callout.info   { background: rgba(54,90,200,0.06); border-color: rgba(54,90,200,0.2); }
[data-theme="light"] .callout.danger { background: rgba(185,52,52,0.06); border-color: rgba(185,52,52,0.2); }
[data-theme="light"] p { color: #5a6278; }
[data-theme="light"] td { color: #5a6278; }
[data-theme="light"] .hero { background: linear-gradient(135deg,rgba(36,150,237,0.07) 0%,rgba(50,108,229,0.05) 100%); }
[data-theme="light"] h2 { border-bottom-color: rgba(0,0,0,0.1); }
[data-theme="light"] .comment { color: #8fa0b0; }
[data-theme="light"] .str { color: #266b26; }
[data-theme="light"] .kw  { color: #8833aa; }
[data-theme="light"] .cmd { color: #1a76be; }
[data-theme="light"] code { background: rgba(0,0,0,0.05); color: #177a60; }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 24px 18px 60px; }
}
