/* ============================================================================
   Server Assistant Wiki — layout + components.
   Layered on top of tokens.css + glass.css (loaded site-wide via the footer).
   Adds: the two-column wiki shell (sidebar + content), search, the wizard
   step-through widget, command reference cards, and a few extra Discord-mockup
   primitives (dropdowns, modals) that extend the shared .dc-* system.
   ============================================================================ */

/* ── Shell ──────────────────────────────────────────────────────────────── */
.wiki-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 2.4rem;
  align-items: start;
}
.wiki-main { min-width: 0; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.wiki-side {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding-right: .4rem;
  font-size: .9rem;
  /* Subtle thin scrollbar, matching the rest of the site (the roadmap's). */
  scrollbar-width: thin;
  scrollbar-color: #cfd8dc transparent;
}
.wiki-side::-webkit-scrollbar, .wiki-search-results::-webkit-scrollbar             { width: 6px; }
.wiki-side::-webkit-scrollbar-track, .wiki-search-results::-webkit-scrollbar-track { background: transparent; }
.wiki-side::-webkit-scrollbar-thumb, .wiki-search-results::-webkit-scrollbar-thumb { background: #cfd8dc; border-radius: 3px; }
.wiki-side::-webkit-scrollbar-thumb:hover, .wiki-search-results::-webkit-scrollbar-thumb:hover { background: #b0bec5; }
.wiki-search-results { scrollbar-width: thin; scrollbar-color: #cfd8dc transparent; }
.wiki-nav-group { margin-bottom: 1.25rem; }
.wiki-nav-title {
  display: flex; align-items: center; gap: .45rem;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-2); margin: 0 0 .5rem;
}
.wiki-nav-ic { font-size: .95rem; }
.wiki-nav ul { list-style: none; margin: 0; padding: 0; }
.wiki-nav li { margin: 0; }
.wiki-nav a {
  display: flex; align-items: center; gap: .4rem;
  padding: .34rem .6rem; border-radius: 8px;
  color: var(--fg-1); text-decoration: none; line-height: 1.3;
  border-left: 2px solid transparent;
}
.wiki-nav a:hover { background: var(--surface); color: var(--fg-0); }
.wiki-nav a.active {
  background: var(--accent-soft); color: var(--fg-0); font-weight: 600;
  border-left-color: var(--accent);
}

/* ── Search ─────────────────────────────────────────────────────────────── */
.wiki-search { position: relative; margin-bottom: 1.4rem; }
.wiki-search-input {
  width: 100%; box-sizing: border-box;
  padding: .55rem .7rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--fg-0); font-size: .9rem; font-family: inherit;
}
.wiki-search-input::placeholder { color: var(--fg-2); }
.wiki-search-input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.wiki-search-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + .35rem);
  list-style: none; margin: 0; padding: .3rem;
  background: var(--glass-strong); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  max-height: 60vh; overflow-y: auto;
}
.wiki-search-results li { margin: 0; }
.wiki-search-results a {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .45rem .55rem; border-radius: 8px; text-decoration: none;
}
.wiki-search-results a:hover { background: var(--surface-2); }
.wiki-sr-title { color: var(--fg-0); font-weight: 600; font-size: .88rem; }
.wiki-sr-cat   { color: var(--fg-2); font-size: .72rem; }
.wiki-sr-empty { padding: .5rem .55rem; color: var(--fg-2); font-size: .85rem; }

/* ── Sidebar toggle (mobile only) ───────────────────────────────────────── */
.wiki-nav-open {
  display: none;
  margin: 0 0 1rem; padding: .5rem .85rem; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--fg-0);
  font-weight: 600; font-size: .9rem; width: max-content;
}

/* ── Breadcrumbs + footer nav ───────────────────────────────────────────── */
.wiki-crumbs { font-size: .8rem; color: var(--fg-2); margin-bottom: .4rem; }
.wiki-crumbs a { color: var(--fg-1); text-decoration: none; }
.wiki-crumbs a:hover { color: var(--accent); }
.wiki-crumbs span { margin: 0 .3rem; opacity: .6; }
.wiki-foot-nav {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--divider);
  font-size: .88rem;
}
.wiki-foot-nav a { text-decoration: none; color: var(--fg-1); }
.wiki-foot-nav a:hover { color: var(--accent); }

/* ── Premium tag ────────────────────────────────────────────────────────── */
.wiki-prem {
  font-size: .56rem; font-weight: 800; letter-spacing: .05em;
  padding: .06rem .3rem; border-radius: 4px; vertical-align: middle;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(245,196,34,.35);
}

/* ── Wizard step-through ────────────────────────────────────────────────── */
.wiz {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--glass-panel); padding: 1rem; margin: 1.4rem 0;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.wiz-bar {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin-bottom: .85rem; padding-bottom: .75rem; border-bottom: 1px solid var(--divider);
}
.wiz-label { font-weight: 700; color: var(--fg-0); flex: 1 1 auto; min-width: 0; }
.wiz-counter { font-size: .78rem; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.wiz-btn {
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  padding: .32rem .7rem; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--fg-0);
}
.wiz-btn:hover:not(:disabled) { background: var(--surface-hi); }
.wiz-btn:disabled { opacity: .4; cursor: default; }
.wiz-dots { display: flex; gap: .35rem; }
.wiz-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--surface-hi); border: none;
}
.wiz-dot.on { background: var(--accent); }
/* Default (no-JS): every step stacked + visible, each with its label shown. */
.wiz-step { margin: 0 0 1rem; }
.wiz-step::before {
  content: attr(data-step); display: block; margin-bottom: .4rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-2);
}
.wiz-step:last-child { margin-bottom: 0; }
/* Enhanced (JS on): show one step at a time; labels move into the top bar. */
.wiz-ready .wiz-step { display: none; }
.wiz-ready .wiz-step.on { display: block; }
.wiz-ready .wiz-step { margin: 0; }
.wiz-ready .wiz-step::before { display: none; }
.wiz-caption { margin-top: .7rem; color: var(--fg-1); font-size: .9rem; line-height: 1.55; }

/* ── Command reference card ─────────────────────────────────────────────── */
.cmd-card {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: 1.1rem 1.25rem; margin: 1.3rem 0;
}
.cmd-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; }
.cmd-name {
  font-family: Consolas, "SF Mono", Menlo, monospace; font-weight: 700; font-size: 1.08rem;
  color: var(--fg-0); background: #1e1f22; padding: .18rem .5rem; border-radius: 6px;
}
.cmd-tag {
  font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: .12rem .42rem; border-radius: 5px; border: 1px solid var(--border); color: var(--fg-1);
}
.cmd-tag.free    { background: rgba(84,224,142,.12); color: var(--ok);   border-color: rgba(84,224,142,.3); }
.cmd-tag.premium { background: var(--gold-soft);     color: var(--gold); border-color: rgba(245,196,34,.35); }
.cmd-tag.perm    { background: rgba(255,148,102,.12); color: var(--high); border-color: rgba(255,148,102,.3); }
.cmd-tag.ai      { background: var(--pink-soft);      color: var(--pink); border-color: rgba(238,91,162,.3); }
.cmd-desc { color: var(--fg-1); margin: .55rem 0 0; line-height: 1.55; }
.cmd-args { width: 100%; border-collapse: collapse; margin: .9rem 0 0; font-size: .88rem; }
.cmd-args th, .cmd-args td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--divider); vertical-align: top; }
.cmd-args th { color: var(--fg-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.cmd-args code { color: var(--accent); }
.cmd-args .req { color: var(--high); font-size: .72rem; font-weight: 700; }
.cmd-args .opt { color: var(--fg-2); font-size: .72rem; }

/* ── Discord-mockup extensions (build on glass.css .dc-*) ───────────────── */
/* A slash-command invocation line (what the user types). */
.dc-slash { color: #b5bac1; }
.dc-slash .cmd { color: #5865f2; font-weight: 600; }
.dc-slash .arg { color: #00a8fc; }
/* A select / dropdown component. */
.dc-select {
  display: flex; justify-content: space-between; align-items: center;
  background: #1e1f22; border: 1px solid #232428; border-radius: 4px;
  padding: .4rem .6rem; margin-top: .55rem; color: #b5bac1; font-size: .8rem;
}
.dc-select::after { content: "▾"; color: #949ba4; }
/* A modal form (the pop-up dialogs). */
.dc-modal {
  background: #313338; border-radius: 8px; padding: .85rem .9rem; margin-top: .15rem;
  border: 1px solid #232428; max-width: 360px;
}
.dc-modal-title { font-weight: 700; color: #f2f3f5; margin-bottom: .15rem; }
.dc-modal-sub   { color: #949ba4; font-size: .72rem; margin-bottom: .6rem; }
.dc-flabel { font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #b5bac1; margin: .5rem 0 .2rem; }
.dc-input {
  background: #1e1f22; border: 1px solid #1e1f22; border-radius: 4px;
  padding: .4rem .55rem; color: #dbdee1; font-size: .8rem; min-height: 1.1rem;
}
.dc-input.ph { color: #6d7178; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media screen and (max-width: 880px) {
  .wiki-shell { grid-template-columns: 1fr; gap: 1rem; }
  .wiki-nav-open { display: block; }
  .wiki-side {
    position: static; max-height: none; overflow: visible;
    display: none;
    margin-bottom: 1rem; padding: 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  }
  .wiki-nav-toggle:checked ~ .wiki-side { display: block; }
}
