/* HoodAPI — dark neon utility console */
:root {
  --bg: #050807;
  --bg-soft: #0a0f0c;
  --panel: #0c1210;
  --panel-2: #101815;
  --line: #1b2723;
  --line-soft: #142019;
  --text: #dfeee6;
  --muted: #7d9389;
  --accent: #2ff07f;
  --accent-2: #14c765;
  --accent-dim: rgba(47, 240, 127, 0.12);
  --danger: #ff5f56;
  --warn: #ffc857;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(47, 240, 127, 0.10), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(20, 199, 101, 0.07), transparent 55%);
  background-attachment: fixed;
}

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

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(5, 8, 7, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 700; letter-spacing: .5px; font-size: 16px; }
.brand-name span { color: var(--accent); }
.brand-tag { font-size: 9.5px; letter-spacing: 2.2px; color: var(--muted); text-transform: uppercase; }

.search-wrap { flex: 1; max-width: 460px; position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .5; }
#search {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
}
#search:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-dim); }
.kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px;
}

.top-links { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.top-links a {
  font-size: 13px; color: var(--muted); padding: 7px 12px; border-radius: 9px;
  border: 1px solid transparent;
}
.top-links a:hover { color: var(--text); background: var(--panel); border-color: var(--line); text-decoration: none; }
.top-links a.icon-link { display: inline-flex; align-items: center; justify-content: center; padding: 8px; }
.top-links a.icon-link svg { display: block; }
.top-links a.icon-link:hover { color: var(--accent); }
.menu-btn {
  display: none; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 10px; cursor: pointer;
}

/* ---------- layout ---------- */
.shell { display: flex; align-items: flex-start; }

.sidebar {
  width: 252px;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 18px 12px 40px;
  border-right: 1px solid var(--line);
}
.sidebar::-webkit-scrollbar, main::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.side-group { margin-bottom: 18px; }
.side-title {
  font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 9px; font-size: 13.5px;
  color: var(--text); opacity: .78; cursor: pointer;
}
.side-link:hover { background: var(--panel); opacity: 1; text-decoration: none; }
.side-link.active { background: var(--accent-dim); color: var(--accent); opacity: 1; }
.side-link .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55; flex-shrink: 0; }
.side-link.server .dot { background: var(--warn); }

main { flex: 1; min-width: 0; padding: 26px 28px 80px; max-width: 1080px; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 26px 0 34px; }
.hero img { width: 118px; height: 118px; border-radius: 26px; margin-bottom: 14px; }
.hero h1 { font-size: 40px; margin: 0 0 6px; letter-spacing: -.5px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); margin: 0 auto; max-width: 620px; }
.hero-stats { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 15px; font-size: 12.5px; color: var(--muted); font-family: var(--mono);
}
.stat b { color: var(--accent); font-weight: 600; }

.cat-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 30px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.cat-head h2 { font-size: 15px; margin: 0; letter-spacing: .3px; }
.cat-head small { color: var(--muted); font-size: 12px; font-family: var(--mono); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
  display: block;
}
.card:hover { border-color: var(--accent-2); transform: translateY(-2px); background: var(--panel-2); text-decoration: none; }
.card h3 { margin: 0 0 5px; font-size: 14.5px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pill {
  font-family: var(--mono); font-size: 9px; letter-spacing: .6px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line);
  color: var(--muted); font-weight: 500;
}
.pill.live { color: var(--warn); border-color: rgba(255, 200, 87, .3); background: rgba(255, 200, 87, .07); }
.pill.local { color: var(--accent); border-color: rgba(47, 240, 127, .25); background: var(--accent-dim); }

/* ---------- tool view ---------- */
.tool-head { margin-bottom: 18px; }
.crumb { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-bottom: 6px; }
.tool-head h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.3px; }
.tool-head p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 760px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.panel + .panel { margin-top: 0; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 190px; }

label.lbl {
  display: block; font-size: 11.5px; letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}

input[type=text], input[type=number], input[type=password], textarea, select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  resize: vertical;
}
textarea { min-height: 108px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-dim); }
select { font-family: var(--sans); cursor: pointer; }
input::placeholder, textarea::placeholder { color: #47564f; }

.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }

.btn {
  background: var(--accent);
  color: #04120a;
  border: none;
  border-radius: 10px;
  padding: 10px 17px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  letter-spacing: .2px;
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.ghost:hover { border-color: var(--accent-2); color: var(--accent); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

.out-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px; gap: 10px;
}
.out-head span {
  font-size: 11.5px; letter-spacing: .7px; text-transform: uppercase; color: var(--muted);
}
.out {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 44px;
  max-height: 460px;
  overflow: auto;
  color: var(--text);
}
.out.empty { color: #47564f; }
.out.error { color: var(--danger); border-color: rgba(255, 95, 86, .32); background: rgba(255, 95, 86, .05); }
.out.good { border-color: rgba(47, 240, 127, .25); }

.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; font-family: var(--mono); font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.kv dd.hl { color: var(--accent); }

.note {
  font-size: 12px; color: var(--muted); margin-top: 10px;
  border-left: 2px solid var(--line); padding-left: 10px;
}
.note.warn { border-color: var(--warn); color: #c9b27a; }

.tabs { display: flex; gap: 6px; margin-bottom: 13px; flex-wrap: wrap; }
.tab {
  padding: 6px 13px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
  font-family: var(--sans);
}
.tab.active { color: var(--accent); border-color: var(--accent-2); background: var(--accent-dim); }

table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; font-family: var(--mono); }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
table.data th { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; }
table.data tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

code.inline {
  font-family: var(--mono); font-size: 12px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--accent);
}

.spinner {
  width: 13px; height: 13px; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%;
  display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--accent-2); color: var(--accent);
  padding: 10px 18px; border-radius: 11px; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 0;
  color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- docs ---------- */
.endpoint {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; margin-bottom: 12px;
}
.endpoint h3 { margin: 0 0 6px; font-size: 14px; font-family: var(--mono); }
.method { color: var(--accent); font-weight: 700; }
.endpoint p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
pre.code {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 13px; overflow-x: auto; font-family: var(--mono); font-size: 12px;
  margin: 0; color: #a9c9b8;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .menu-btn { display: block; order: -1; }
  .sidebar {
    position: fixed; left: 0; top: 56px; bottom: 0; z-index: 45;
    background: var(--bg-soft); transform: translateX(-102%); transition: transform .2s;
    height: auto; box-shadow: 12px 0 40px rgba(0, 0, 0, .6);
  }
  .sidebar.open { transform: translateX(0); }
  main { padding: 20px 16px 60px; }
  .top-links a.hide-sm { display: none; }
  .hero h1 { font-size: 30px; }
  .search-wrap { max-width: none; }
  .kbd { display: none; }
}
@media (max-width: 560px) {
  .brand-text { display: none; }
  /* Give the shrinking search field its width back on phones. */
  .top-links { gap: 4px; }
  .top-links a { padding: 7px 9px; }
  .top-links a.icon-link { padding: 7px 5px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 7px; }
}
