/* =========================================================
   web3sdk/laravel — Documentation Stylesheet
   ========================================================= */

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #ffffff;
  color: #1a1a2e;
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --------------------------------------------- */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  background: #1a1a2e;
  color: #c9d1d9;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #30365a #1a1a2e;
}
#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-track { background: #1a1a2e; }
#sidebar::-webkit-scrollbar-thumb { background: #30365a; border-radius: 3px; }

.sidebar-brand {
  display: block;
  padding: 20px 20px 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid #2d3561;
  letter-spacing: -0.01em;
}
.sidebar-brand span {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: #7b8498;
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav { padding: 12px 0 24px; flex: 1; }

.sidebar-section-label {
  display: block;
  padding: 14px 20px 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a5270;
}

.sidebar-divider {
  height: 1px;
  background: #2d3561;
  margin: 8px 16px;
}

.sidebar-nav a {
  display: block;
  padding: 6px 20px;
  color: #8b92a8;
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav a:hover {
  color: #e6edf3;
  background: rgba(255,255,255,0.04);
}
.sidebar-nav a.active {
  color: #58a6ff;
  border-left-color: #58a6ff;
  background: rgba(88,166,255,0.08);
  font-weight: 500;
}

/* --- Main content ---------------------------------------- */
main {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  padding: 0 0 80px;
}

.content-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 40px;
}

/* --- Hamburger (mobile) ---------------------------------- */
#hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  background: #1a1a2e;
  border: none;
  color: #c9d1d9;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
}
#hamburger svg { display: block; }

/* --- Typography ------------------------------------------ */
h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #0d1117;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}
h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #0d1117;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f2f5;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 28px 0 10px;
}
h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #30365a;
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
p { margin-bottom: 14px; color: #374151; }
p:last-child { margin-bottom: 0; }

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Page hero ------------------------------------------ */
.page-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  padding: 60px 40px;
  margin-bottom: 0;
}
.page-hero h1 {
  color: #fff;
  font-size: 2.4rem;
  margin-bottom: 10px;
}
.page-hero p {
  color: rgba(255,255,255,0.72);
  font-size: 1.1rem;
  margin: 0;
}

/* --- Section accent header ------------------------------- */
.section-header {
  border-left: 4px solid #2563eb;
  padding-left: 12px;
  margin: 36px 0 16px;
}
.section-header h2 {
  border-bottom: none;
  margin: 0;
  padding: 0;
}

/* --- Method cards --------------------------------------- */
.method-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 32px;
  overflow: hidden;
}
.method-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 8px;
}
.method-name {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
}
.method-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.method-body { padding: 18px; }
.method-desc { color: #374151; margin-bottom: 16px; }

/* --- HTTP method badges --------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.badge-get    { background: #dbeafe; color: #1d4ed8; }
.badge-post   { background: #dcfce7; color: #15803d; }
.badge-patch  { background: #fef3c7; color: #92400e; }
.badge-delete { background: #fee2e2; color: #b91c1c; }
.badge-put    { background: #ede9fe; color: #6d28d9; }

/* --- Credit cost badges --------------------------------- */
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  white-space: nowrap;
}
.credit-badge::before { content: '◆'; font-size: 0.6rem; }
.credit-0  { background: #f3f4f6; color: #6b7280; }
.credit-1  { background: #cffafe; color: #0e7490; }
.credit-2  { background: #d1fae5; color: #065f46; }
.credit-5  { background: #fde68a; color: #92400e; }
.credit-10 { background: #fee2e2; color: #b91c1c; }

/* --- Auth requirement badge ----------------------------- */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-jwt    { background: #ede9fe; color: #5b21b6; }
.auth-apikey { background: #fef3c7; color: #92400e; }
.auth-any    { background: #f0fdf4; color: #166534; }

/* --- Parameter tables ----------------------------------- */
.params-table-wrap { overflow-x: auto; margin: 14px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead tr { background: #f8fafc; }
th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
td {
  padding: 9px 14px;
  border-bottom: 1px solid #f0f2f5;
  color: #4b5563;
  vertical-align: top;
}
tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:last-child td { border-bottom: none; }
td code, th code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.82rem;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 3px;
  color: #1a1a2e;
}
.required-yes { color: #dc2626; font-weight: 600; font-size: 0.8rem; }
.required-no  { color: #9ca3af; font-size: 0.8rem; }

/* --- Code blocks ---------------------------------------- */
pre {
  margin: 14px 0;
  border-radius: 8px;
  overflow-x: auto;
}
pre code.hljs {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  font-size: 0.835rem;
  line-height: 1.6;
  border-radius: 8px;
  padding: 18px 20px !important;
}

/* Fallback for non-highlighted code */
pre:not([class]) {
  background: #0d1117;
  color: #e6edf3;
  padding: 18px 20px;
}

code:not(.hljs) {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85em;
  background: #f3f4f6;
  color: #1a1a2e;
  padding: 2px 6px;
  border-radius: 4px;
}

/* --- Inline code in headings ---------------------------- */
h2 code, h3 code { font-size: 0.9em; }

/* --- Callout / alert boxes ------------------------------ */
.callout {
  border-radius: 6px;
  padding: 14px 18px;
  margin: 16px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.callout-info    { background: #eff6ff; border-left: 4px solid #3b82f6; }
.callout-warning { background: #fffbeb; border-left: 4px solid #f59e0b; }
.callout-danger  { background: #fef2f2; border-left: 4px solid #ef4444; }
.callout-success { background: #f0fdf4; border-left: 4px solid #22c55e; }

/* --- Quick install box ---------------------------------- */
.install-box {
  background: #0d1117;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.install-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: #79c0ff;
  background: transparent;
  padding: 0;
}
.install-box .install-label {
  font-size: 0.72rem;
  color: #6e7681;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* --- Nav cards (index page) ----------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.nav-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
  display: block;
}
.nav-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  border-color: #c7d2fe;
  transform: translateY(-1px);
  text-decoration: none;
}
.nav-card-icon { font-size: 1.5rem; margin-bottom: 8px; }
.nav-card-title { font-weight: 600; color: #1a1a2e; margin-bottom: 4px; font-size: 0.95rem; }
.nav-card-desc  { font-size: 0.8rem; color: #6b7280; line-height: 1.4; }

/* --- Exception hierarchy -------------------------------- */
.exception-hierarchy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px 22px;
  color: #374151;
  line-height: 2;
  margin: 16px 0;
}
.exception-hierarchy .exc-root   { color: #6b7280; }
.exception-hierarchy .exc-base   { color: #1d4ed8; font-weight: 600; }
.exception-hierarchy .exc-child  { color: #059669; font-weight: 600; }

/* --- Credit tier table ---------------------------------- */
.credit-tier {
  margin-bottom: 24px;
}
.credit-tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.credit-tier-label {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* --- Env vars table ------------------------------------- */
.env-var { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 0.83rem; }

/* --- Footer --------------------------------------------- */
footer {
  border-top: 1px solid #e5e7eb;
  padding: 24px 40px;
  color: #9ca3af;
  font-size: 0.83rem;
  margin-left: 260px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
footer a { color: #6b7280; }
footer a:hover { color: #374151; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 768px) {
  #hamburger { display: block; }

  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.3);
  }

  main { margin-left: 0; }
  .content-wrapper { padding: 68px 20px 40px; }
  .page-hero { padding: 50px 20px 40px; margin-top: 44px; }

  footer { margin-left: 0; padding: 20px; }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }

  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .method-header { flex-direction: column; align-items: flex-start; }
}

/* --- Utility classes ------------------------------------ */
.mt-0  { margin-top: 0 !important; }
.mb-0  { margin-bottom: 0 !important; }
.text-muted { color: #9ca3af; }
.mono { font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace; }
.font-bold { font-weight: 700; }
.highlight-block {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin: 12px 0;
}
