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

:root {
  --bg-primary: #1C1C2E;
  --bg-secondary: #252540;
  --bg-tertiary: #2E2E4A;
  --bg-surface: #1A1A2C;
  --bg-code: #13131F;
  --bg-input: #16162A;
  --accent: #FF6C37;
  --accent-hover: #FF8255;
  --accent-subtle: rgba(255, 108, 55, 0.12);
  --purple: #7B68EE;
  --purple-subtle: rgba(123, 104, 238, 0.12);
  --text-primary: #E8E8F0;
  --text-secondary: #9B9BB0;
  --text-muted: #6B6B80;
  --border: #2E2E4A;
  --border-light: #3A3A55;
  --get: #49CC90;
  --post: #FCA130;
  --put: #61AFFE;
  --delete: #F93E3E;
  --patch: #50E3C2;
  --success: #49CC90;
  --warning: #FCA130;
  --danger: #F93E3E;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

code, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Top Nav ── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(28, 28, 46, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 36px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent) 0%, #FF8F6B 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition);
  min-width: 220px;
}

.nav-search:hover { border-color: var(--border-light); }

.nav-search kbd {
  margin-left: auto;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-secondary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple) 0%, #9B8AFF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

/* ── Method badges ── */
.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 52px;
}

.method-get { background: rgba(73, 204, 144, 0.15); color: var(--get); }
.method-post { background: rgba(252, 161, 48, 0.15); color: var(--post); }
.method-put { background: rgba(97, 175, 254, 0.15); color: var(--put); }
.method-delete { background: rgba(249, 62, 62, 0.15); color: var(--delete); }
.method-patch { background: rgba(80, 227, 194, 0.15); color: var(--patch); }

/* ── Status badges ── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-success { background: rgba(73, 204, 144, 0.12); color: var(--success); }
.status-warning { background: rgba(252, 161, 48, 0.12); color: var(--warning); }
.status-danger { background: rgba(249, 62, 62, 0.12); color: var(--danger); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Code blocks ── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-secondary);
}

.code-block .keyword { color: #C792EA; }
.code-block .string { color: #C3E88D; }
.code-block .number { color: #F78C6C; }
.code-block .comment { color: #546E7A; }
.code-block .function { color: #82AAFF; }
.code-block .property { color: #FFCB6B; }
.code-block .operator { color: #89DDFF; }
.code-block .punctuation { color: #89DDFF; }

/* ── Cards ── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}

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

/* ── Sections ── */
.section {
  padding: 80px 0;
}

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

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

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

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

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

table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover { color: var(--text-secondary); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Tag / Chip ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.tag-accent {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 4px 0;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

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

.footer-bottom-links a {
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.6s ease forwards;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 28px; }
  .container { padding: 0 20px; }
  .topnav { padding: 0 16px; }
}
