/* ============================================================
   CloudVantage Documentation — styles.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&family=IBM+Plex+Serif:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface2:     #1c2330;
  --surface3:     #212936;
  --border:       #30363d;
  --border-light: #3d444d;
  --accent:       #38bdf8;
  --accent2:      #7dd3fc;
  --accent-dim:   rgba(56,189,248,0.08);
  --accent-glow:  rgba(56,189,248,0.15);
  --text:         #e6edf3;
  --text-muted:   #7d8590;
  --text-subtle:  #484f58;
  --warning:      #f0883e;
  --danger:       #f85149;
  --success:      #3fb950;
  --heading:      #ffffff;
  --sidebar-w:    272px;
  --header-h:     58px;
  --radius:       8px;
  --radius-sm:    4px;
  --transition:   0.18s ease;
}

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

/* ── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 200;
  gap: 14px;
  backdrop-filter: blur(8px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.logo-mark { 
  width: 42px; 
  height: 42px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

.logo-mark img { width: 42px; height: 42px; object-fit: contain; }
.logo:hover .logo-mark { box-shadow: 0 0 20px var(--accent-glow); }

.logo-text {
  font-family: 'IBM Plex Serif', serif;
  font-size: 17px;
  color: var(--heading);
  letter-spacing: -0.3px;
}
.logo-text span { color: var(--accent); }

.hdr-div {
  width: 1px; height: 22px;
  background: var(--border);
}

.hdr-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.hdr-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'IBM Plex Sans', sans-serif;
  width: 240px;
  cursor: text;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.hdr-search:hover,
.hdr-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.hdr-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: 'IBM Plex Sans', sans-serif;
  width: 100%;
}
.hdr-search input::placeholder { color: var(--text-muted); }

.hdr-search-kbd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-subtle);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: auto;
  white-space: nowrap;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(var(--header-h) - 6px);
  right: 24px;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: none;
  z-index: 300;
  overflow: hidden;
}
.search-results.visible { display: block; }

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-dim); }

.sri-icon {
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}
.sri-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--heading);
  margin-bottom: 2px;
}
.sri-section {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}
.search-no-results {
  padding: 20px 14px;
  color: var(--text-muted);
  font-size: 13.5px;
  text-align: center;
}

/* ── Layout ─────────────────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 20px 0 40px;
  transition: transform var(--transition);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.nav-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-subtle);
  padding: 10px 18px 5px;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 2px solid transparent;
  user-select: none;
}
.nav-item:hover {
  color: var(--text);
  background: var(--accent-dim);
}
.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.ico {
  width: 15px; height: 15px;
  opacity: 0.65;
  flex-shrink: 0;
}
.nav-item.active .ico { opacity: 1; }

.nav-sub {
  padding-left: 41px;
  font-size: 13px;
  color: var(--text-subtle);
}
.nav-sub:hover { color: var(--text-muted); }
.nav-sub.active { color: var(--accent); }

.nb {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 8px;
  color: var(--text-subtle);
}
.nb.soon {
  color: var(--warning);
  border-color: rgba(240,136,62,0.3);
  background: rgba(240,136,62,0.05);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 18px;
}

.nav-off {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ── Main content ───────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

.ca {
  max-width: 860px;
  margin: 0 auto;
  padding: 44px 48px 100px;
}

/* ── Page transitions ───────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page.active .ca {
  animation: fadeUp 0.22s ease;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.bc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-bottom: 28px;
}
.bc a {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}
.bc a:hover { color: var(--accent); }
.bc .cur { color: var(--accent); }

/* ── Page header ────────────────────────────────────────────── */
.ph {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.ey {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: block;
}

.pt {
  font-family: 'IBM Plex Serif', serif;
  font-size: 34px;
  font-weight: 500;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.pd {
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 620px;
}

/* ── Typography ─────────────────────────────────────────────── */
h2 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 21px;
  font-weight: 500;
  color: var(--heading);
  margin: 40px 0 14px;
  padding-top: 4px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 26px 0 10px;
}

h4 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 8px;
}

p {
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.75;
}

a {
  color: var(--accent2);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}
a:hover { text-decoration: underline; color: var(--accent); }

strong { color: var(--text); font-weight: 600; }

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}

pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  overflow-x: auto;
  margin: 18px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  position: relative;
}
pre::-webkit-scrollbar { height: 4px; }
pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

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

/* Copy button on code blocks */
.pre-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
}
.pre-wrap:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

ol, ul {
  padding-left: 22px;
  margin-bottom: 14px;
}

li {
  margin-bottom: 7px;
  line-height: 1.7;
}
li strong { color: var(--text); }

/* ── Divider ────────────────────────────────────────────────── */
.div {
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

/* ── Callouts ───────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid;
}

.callout-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1.7;
}

.callout-body { flex: 1; }

.callout-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.callout p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.warn {
  background: rgba(240,136,62,0.05);
  border-color: rgba(240,136,62,0.25);
}
.warn .callout-title { color: var(--warning); }

.danger {
  background: rgba(248,81,73,0.05);
  border-color: rgba(248,81,73,0.25);
}
.danger .callout-title { color: var(--danger); }

.info {
  background: rgba(56,189,248,0.05);
  border-color: rgba(56,189,248,0.25);
}
.info .callout-title { color: var(--accent); }

.success-callout {
  background: rgba(63,185,80,0.05);
  border-color: rgba(63,185,80,0.25);
}
.success-callout .callout-title { color: var(--success); }

/* ── Steps ──────────────────────────────────────────────────── */
.steps {
  counter-reset: steps;
  list-style: none;
  padding: 0;
  margin: 20px 0;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  left: 14px; top: 28px; bottom: 28px;
  width: 1px;
  background: var(--border);
}

.steps li {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  position: relative;
}

.sn {
  counter-increment: steps;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.sn::before { content: counter(steps); }

.sb { flex: 1; padding-top: 3px; }
.st { font-weight: 600; color: var(--heading); margin-bottom: 3px; font-size: 14.5px; }
.sb p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 4px; }
.sb ul { margin: 6px 0 0; }
.sb li { font-size: 13.5px; color: var(--text-muted); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin: 18px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.table-wrap table {
  margin: 0;
  border: none;
  border-radius: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13.5px;
}

th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  white-space: nowrap;
}
th:not(:last-child) { border-right: 1px solid var(--border); }

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
td:not(:last-child) { border-right: 1px solid var(--border); }

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(56,189,248,0.03); }

/* ── Card grid ──────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: block;
  text-decoration: none;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  text-decoration: none;
}

.card-icon { width: 32px; height: 32px; margin-bottom: 10px; color: var(--accent); flex-shrink: 0; }
.card-icon svg { width: 32px; height: 32px; display: block; }

.card-title {
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 5px;
  font-size: 14px;
}
.card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.card.dim { opacity: 0.4; cursor: default; pointer-events: none; }
.card-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(240,136,62,0.1);
  color: var(--warning);
  border: 1px solid rgba(240,136,62,0.2);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero { margin-bottom: 48px; }

.hero h1 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 42px;
  font-weight: 500;
  color: var(--heading);
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin-bottom: 18px;
}
.hero h1 span { color: var(--accent); }

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 28px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0d1117;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  text-decoration: none;
}
.cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
  color: #0d1117;
}

/* ── Section heading ────────────────────────────────────────── */
.sec-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 44px 0 18px;
}
.sec-h h2 { margin: 0; padding: 0; }
.sec-h-line { flex: 1; height: 1px; background: var(--border); }

/* ── Method / type tags ─────────────────────────────────────── */
.mt {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.mt-r { background: rgba(248,81,73,0.12); color: var(--danger); }
.mt-s { background: rgba(125,211,252,0.12); color: var(--accent2); }
.mt-w { background: rgba(240,136,62,0.12); color: var(--warning); }
.mt-g { background: rgba(63,185,80,0.12); color: var(--success); }

/* ── Checklist ──────────────────────────────────────────────── */
.checklist {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 13.5px;
}
.checklist li::before {
  content: '☐';
  color: var(--text-muted);
  font-size: 15px;
  flex-shrink: 0;
  line-height: 1.5;
}
.checklist li.done::before {
  content: '✓';
  color: var(--success);
}

/* ── On-this-page TOC ───────────────────────────────────────── */
.otp {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  float: right;
  width: 200px;
  margin: 0 0 40px 40px;
  font-size: 12px;
}
.otp-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-subtle);
  margin-bottom: 10px;
}
.otp a {
  display: block;
  color: var(--text-muted);
  padding: 3px 0 3px 10px;
  border-left: 2px solid var(--border);
  text-decoration: none;
  font-size: 12px;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.otp a:hover { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.otp a.active { color: var(--accent); border-left-color: var(--accent); }

/* ── Mobile sidebar toggle ──────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  transition: color var(--transition);
}
.sidebar-toggle:hover { color: var(--text); }

/* ── Back to top ────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), color var(--transition), border-color var(--transition);
  z-index: 100;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .otp { display: none; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-272px);
    width: 272px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    background: var(--surface);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-toggle { display: flex; }

  .main { margin-left: 0; }

  .ca { padding: 28px 20px 80px; }

  .hero h1 { font-size: 30px; }
  .pt { font-size: 26px; }
  .hdr-search { width: 160px; }
  .hdr-search-kbd { display: none; }
}


/* ── Prev / Next page navigation ─────────────────────────── */
.page-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); gap: 12px; }
.page-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13.5px; transition: border-color 0.15s, background 0.15s; max-width: 48%; cursor: pointer; }
.page-nav a:hover { border-color: var(--accent); background: var(--accent-dim); }
.page-nav a svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent); }
.page-nav-label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.page-nav-title { font-weight: 500; color: var(--heading); display: block; }
.page-nav a:hover .page-nav-title { color: var(--accent); }
.page-nav-spacer { flex: 1; }
