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

/* ─── Design tokens (matches hyfa.id exactly) ─────────── */
:root {
  --bg:          #0f1410;
  --bg-card:     #141a14;
  --bg-card2:    #1a211a;
  --border:      #2a352a;
  --border-glow: #3a4d3a;
  --green:       #7cb342;
  --green-dim:   #4a7c2a;
  --green-glow:  rgba(124, 179, 66, 0.15);
  --green-glow2: rgba(124, 179, 66, 0.06);
  --text:        #e8f0e8;
  --text-muted:  #8fa88f;
  --text-dim:    #5a6e5a;
  --mono:        "Cascadia Mono", "Cascadia Code", Consolas, "Lucida Console", monospace;
  --sans:        "Segoe UI", Aptos, "Helvetica Neue", Arial, sans-serif;
  --nav-h:       60px;
  --sidebar-w:   260px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Shared nav ───────────────────────────────────────── */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 16, 0.92);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 100%;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .site-name {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-links a.active { color: var(--green); }

.btn {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-green {
  background: var(--green);
  color: #0f1410;
}

.btn-green:hover {
  background: #8dc44f;
  box-shadow: 0 0 18px rgba(124, 179, 66, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green-dim);
}

.btn-outline:hover {
  border-color: var(--green);
  background: var(--green-glow2);
}

/* ─── Docs layout (sidebar + content) ─────────────────── */
.docs-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* ─── Sidebar ──────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 20px;
  margin-bottom: 8px;
  display: block;
}

.sidebar-links {
  list-style: none;
}

.sidebar-links a {
  display: block;
  padding: 7px 20px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.sidebar-links a:hover {
  color: var(--text);
  background: var(--green-glow2);
}

.sidebar-links a.active {
  color: var(--green);
  border-left-color: var(--green);
  background: var(--green-glow2);
}

.sidebar-links .sub a {
  padding-left: 32px;
  font-size: 13px;
}

/* ─── Doc content area ─────────────────────────────────── */
.doc-content {
  padding: 48px 56px 80px;
  max-width: 860px;
  min-width: 0;
}

.doc-content h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.doc-content h1 span { color: var(--green); }

.doc-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.doc-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text);
}

.doc-content p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.doc-content p a {
  color: var(--green);
  text-decoration: none;
}

.doc-content p a:hover { text-decoration: underline; }

.doc-content ul, .doc-content ol {
  margin: 12px 0 16px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.doc-content li { margin-bottom: 6px; line-height: 1.65; }

/* ─── Tag / badge ──────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  border: 1px solid var(--green-dim);
  border-radius: 4px;
  padding: 3px 9px;
  margin-bottom: 16px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ─── Inline code ──────────────────────────────────────── */
code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--green);
}

/* ─── Code blocks ──────────────────────────────────────── */
pre {
  background: var(--bg-card2) !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0 24px;
  font-size: 13px;
  line-height: 1.6;
}

pre code {
  background: none !important;
  border: none !important;
  padding: 0;
  color: var(--text);
  font-size: 13px;
}

/* Code block header (optional label) */
.code-block {
  margin: 16px 0 24px;
}

.code-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-label .lang-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-dim);
}

.code-block pre {
  margin: 0;
  border-radius: 0 0 6px 6px;
  border-top: none;
}

/* ─── API endpoint block ───────────────────────────────── */
.endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 32px 0;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
}

.method-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.method-get  { background: rgba(124,179,66,0.15); color: var(--green); border: 1px solid var(--green-dim); }
.method-post { background: rgba(100,140,255,0.12); color: #7eb4ff; border: 1px solid rgba(100,140,255,0.3); }
.method-put  { background: rgba(255,170,50,0.12);  color: #ffb347; border: 1px solid rgba(255,170,50,0.3); }
.method-del  { background: rgba(255,80,80,0.12);   color: #ff6666; border: 1px solid rgba(255,80,80,0.3); }

.endpoint-path {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
}

.endpoint-desc {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
}

.endpoint-body {
  padding: 24px;
}

.endpoint-body > * + * { margin-top: 20px; }

.endpoint-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
  margin-bottom: 10px;
}

/* ─── Params / response tables ─────────────────────────── */
.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.params-table thead th {
  text-align: left;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
  font-weight: 600;
}

.params-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
  line-height: 1.5;
}

.params-table tbody tr:last-child td { border-bottom: none; }
.params-table tbody tr:hover td { background: var(--green-glow2); }

.params-table td.field-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.params-table td.field-type {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.required-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(124,179,66,0.12);
  color: var(--green);
  border: 1px solid var(--green-dim);
  margin-left: 4px;
}

/* ─── Status code list ─────────────────────────────────── */
.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.status-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}

.status-table tr:last-child td { border-bottom: none; }

.status-code {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status-2xx { color: var(--green); }
.status-4xx { color: #ffb347; }
.status-5xx { color: #ff6666; }

.error-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ─── Info / note boxes ────────────────────────────────── */
.doc-note {
  background: var(--green-glow2);
  border: 1px solid var(--green-dim);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.doc-note .note-icon {
  color: var(--green);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── "Coming soon" placeholder ────────────────────────── */
.coming-soon {
  margin-top: 48px;
  text-align: center;
  padding: 64px 0;
}

.coming-soon .cs-icon {
  font-size: 48px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.coming-soon h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  border: none;
  padding: 0;
  margin-top: 0;
  color: var(--text);
}

.coming-soon p {
  max-width: 480px;
  margin: 0 auto 24px;
  font-size: 15px;
  color: var(--text-muted);
}

/* ─── Landing page (full-width, no sidebar) ────────────── */
body.landing {
  padding-top: var(--nav-h);
}

.landing-hero {
  padding: 80px 0 72px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.landing-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
}

.landing-hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 18px;
}

.landing-hero h1 span { color: var(--green); }

.landing-hero p {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}

.landing-section:last-of-type { border-bottom: none; }

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.landing-section h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.landing-section h2 span { color: var(--green); }

.landing-section .sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 40px;
  line-height: 1.65;
}

/* ─── Cards (landing) ──────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.2s;
  text-decoration: none;
  display: block;
}

.card:hover { border-color: var(--border-glow); }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--green-glow);
  border: 1px solid var(--green-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 18px;
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.card .card-link {
  margin-top: 16px;
  font-size: 13px;
  color: var(--green);
  font-family: var(--mono);
}

/* ─── Quick start strip ────────────────────────────────── */
.steps {
  display: flex;
  gap: 0;
  flex-direction: column;
  margin-top: 32px;
}

.step {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.step:last-child { border-bottom: none; }

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green-glow);
  border: 1px solid var(--green-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-body h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step-body p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ─── Footer ───────────────────────────────────────────── */
footer {
  padding: 28px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--green);
  text-decoration: none;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-muted); }

/* ─── Mobile hamburger toggle ──────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .docs-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    width: var(--sidebar-w);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--border);
    background: var(--bg);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }

  .sidebar-toggle {
    display: flex;
  }

  .doc-content {
    padding: 32px 24px 64px;
  }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .landing-hero { padding: 56px 0 48px; }
  .landing-section { padding: 48px 0; }
  .doc-content { padding: 24px 16px 56px; }
  .endpoint-header { flex-wrap: wrap; gap: 8px; }
  .endpoint-desc { margin-left: 0; text-align: left; }
}
