/* Wissify Developers: estilos del sitio de documentación */

:root {
  --brand: #4600cd;
  --brand-strong: #3a00aa;
  --brand-soft: #f1ebff;
  --brand-text: #4600cd;

  --bg: #ffffff;
  --bg-subtle: #f8f8fb;
  --bg-muted: #f1f1f6;
  --border: #e5e5ee;
  --border-strong: #d4d4e0;
  --text: #16161d;
  --text-muted: #5b5b6e;
  --text-faint: #8a8a9c;

  --code-bg: #14121f;
  --code-bg-2: #1c1a2b;
  --code-border: #2a2740;
  --code-text: #e7e5f2;
  --code-muted: #8f8aa8;
  --tok-key: #b9a4ff;
  --tok-str: #9be3b4;
  --tok-num: #ffc38a;
  --tok-lit: #ff9ec7;
  --tok-com: #6f6a88;
  --tok-kw: #8fc8ff;

  --get: #0a7d4f;      --get-bg: #e3f6ee;
  --post: #1e5fd6;     --post-bg: #e5eeff;
  --put: #9a5b00;      --put-bg: #fff1dc;
  --patch: #8a3fc7;    --patch-bg: #f4e9ff;
  --delete: #c22a3a;   --delete-bg: #ffe8eb;

  --warn-bg: #fff7e6; --warn-border: #f3d28b; --warn-text: #7a4b00;
  --info-bg: #eef3ff; --info-border: #c6d5ff; --info-text: #23408f;

  --radius: 10px;
  --header-h: 60px;
  --sidebar-w: 272px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #9b7bff; --brand-strong: #b49bff; --brand-soft: #231a40; --brand-text: #b49bff;
    --bg: #0f0e16; --bg-subtle: #14131d; --bg-muted: #1b1a26; --border: #262434; --border-strong: #34314a;
    --text: #ecebf3; --text-muted: #a9a7bd; --text-faint: #78758f;
    --code-bg: #0b0a12; --code-bg-2: #13121d; --code-border: #262434;
    --get: #4fd69c; --get-bg: #0f2a20; --post: #7eaaff; --post-bg: #13203d; --put: #f0b35c; --put-bg: #2e2110;
    --patch: #c79bff; --patch-bg: #261a3a; --delete: #ff8592; --delete-bg: #35151b;
    --warn-bg: #2a2010; --warn-border: #5c4416; --warn-text: #f3cf8a;
    --info-bg: #141d36; --info-border: #2a3b6b; --info-text: #aac0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #9b7bff; --brand-strong: #b49bff; --brand-soft: #231a40; --brand-text: #b49bff;
  --bg: #0f0e16; --bg-subtle: #14131d; --bg-muted: #1b1a26; --border: #262434; --border-strong: #34314a;
  --text: #ecebf3; --text-muted: #a9a7bd; --text-faint: #78758f;
  --code-bg: #0b0a12; --code-bg-2: #13121d; --code-border: #262434;
  --get: #4fd69c; --get-bg: #0f2a20; --post: #7eaaff; --post-bg: #13203d; --put: #f0b35c; --put-bg: #2e2110;
  --patch: #c79bff; --patch-bg: #261a3a; --delete: #ff8592; --delete-bg: #35151b;
  --warn-bg: #2a2010; --warn-border: #5c4416; --warn-text: #f3cf8a;
  --info-bg: #141d36; --info-border: #2a3b6b; --info-text: #aac0ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.65 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { height: 24px; width: auto; display: block; }
:root[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: brightness(0) invert(1); } }
.brand .tag {
  font-size: 12px; font-weight: 600; color: var(--brand-text); background: var(--brand-soft);
  padding: 2px 8px; border-radius: 999px; letter-spacing: .02em;
}
.header-nav { display: flex; gap: 4px; margin-left: 12px; }
.header-nav a { color: var(--text-muted); font-weight: 500; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.header-nav a:hover, .header-nav a.active { color: var(--text); background: var(--bg-muted); text-decoration: none; }
.header-spacer { flex: 1; }
.search-btn {
  display: flex; align-items: center; gap: 8px; min-width: 240px; height: 36px; padding: 0 10px;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-faint); font: inherit; font-size: 14px; cursor: pointer;
}
.search-btn:hover { border-color: var(--border-strong); }
.search-btn svg { width: 16px; height: 16px; flex: none; }
.search-btn span { white-space: nowrap; }
.search-btn kbd { margin-left: auto; font-size: 11px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); border-radius: 8px; cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.env-select {
  height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 13px; padding: 0 8px; cursor: pointer;
}

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.sidebar {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
  border-right: 1px solid var(--border); padding: 20px 12px 40px; background: var(--bg);
}
.side-section { margin-bottom: 22px; }
.side-title { font-size: 12px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 6px; }
.side-link {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px;
  color: var(--text-muted); font-size: 14px; line-height: 1.35;
}
.side-link:hover { background: var(--bg-muted); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.side-sub { margin: 2px 0 8px 10px; padding-left: 8px; border-left: 1px solid var(--border); }
.side-sub .side-link { font-size: 13px; padding: 4px 8px; }
.side-sub .side-link .m { flex: none; }
.side-link .label { overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; }
.content { max-width: 1240px; padding: 40px 48px 80px; }
.prose { max-width: 760px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 23px; margin: 44px 0 12px; }
h3 { font-size: 18px; margin: 30px 0 10px; }
h4 { font-size: 15px; margin: 22px 0 8px; }
.lead { font-size: 17px; color: var(--text-muted); margin: 0 0 28px; max-width: 720px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose :not(pre) > code, .endpoint :not(pre) > code, .params :not(pre) > code {
  font-size: .86em; padding: 1px 6px; border-radius: 5px; background: var(--bg-muted);
  border: 1px solid var(--border); color: var(--text); word-break: break-word;
}
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 600; color: var(--text-muted); font-size: 13px; background: var(--bg-subtle); }
.prose blockquote {
  margin: 18px 0; padding: 12px 16px; border-radius: var(--radius);
  background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-text);
}
.prose blockquote p { margin: 0; color: inherit; }
.prose blockquote.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.heading-anchor { color: inherit; }
.heading-anchor:hover { text-decoration: none; color: var(--brand-text); }

/* ---------- Code ---------- */
pre {
  margin: 16px 0; padding: 16px 18px; overflow-x: auto; border-radius: var(--radius);
  background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-border);
  font-size: 13px; line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-lit { color: var(--tok-lit); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-kw { color: var(--tok-kw); }

.codebox { border-radius: var(--radius); overflow: hidden; background: var(--code-bg); border: 1px solid var(--code-border); margin: 0 0 16px; }
.codebox-head {
  display: flex; align-items: center; gap: 2px; padding: 0 8px 0 6px; min-height: 40px;
  background: var(--code-bg-2); border-bottom: 1px solid var(--code-border);
}
.codebox-title { color: var(--code-muted); font-size: 12px; font-weight: 600; padding: 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.codebox-tab {
  border: 0; background: none; color: var(--code-muted); font: inherit; font-size: 12.5px; font-weight: 500;
  padding: 10px 9px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.codebox-tab:hover { color: var(--code-text); }
.codebox-tab[aria-selected="true"] { color: var(--code-text); border-bottom-color: var(--brand); }
.codebox-spacer { flex: 1; }
.copy-btn {
  border: 1px solid var(--code-border); background: transparent; color: var(--code-muted); border-radius: 6px;
  font: inherit; font-size: 12px; padding: 3px 9px; cursor: pointer;
}
.copy-btn:hover { color: var(--code-text); border-color: var(--code-muted); }
.codebox pre { margin: 0; border: 0; border-radius: 0; max-height: 520px; }
.codebox-panel[hidden] { display: none; }
.status-pill { font-family: var(--mono); font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: #123524; color: #8ee6b4; margin-left: 4px; }
.status-pill.s4, .status-pill.s5 { background: #3a1520; color: #ffadb7; }

/* ---------- Method badges ---------- */
.m {
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono);
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; border-radius: 5px; padding: 1px 6px; min-width: 44px;
}
.m-GET { color: var(--get); background: var(--get-bg); }
.m-POST { color: var(--post); background: var(--post-bg); }
.m-PUT { color: var(--put); background: var(--put-bg); }
.m-PATCH { color: var(--patch); background: var(--patch-bg); }
.m-DELETE { color: var(--delete); background: var(--delete-bg); }
.side-sub .m { font-size: 9.5px; min-width: 40px; padding: 0 4px; }

/* ---------- Reference ---------- */
.ref-head { padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.ref-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 0 32px; margin-top: 20px; }
.ref-index a { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--text); font-size: 14px; border-bottom: 1px dashed var(--border); }
.ref-index a:hover { color: var(--brand-text); text-decoration: none; }
.ref-index .path { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; direction: rtl; text-align: right; }
.ref-index .m { flex: none; }

.endpoint {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px;
  padding: 44px 0; border-bottom: 1px solid var(--border);
}
.endpoint:last-child { border-bottom: 0; }
.endpoint h2 { margin: 0 0 10px; font-size: 22px; }
.endpoint-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px;
  font-family: var(--mono); font-size: 13.5px; padding: 8px 12px; border-radius: 8px;
  background: var(--bg-subtle); border: 1px solid var(--border);
}
.endpoint-line .path { word-break: break-all; color: var(--text); }
.endpoint-line .path .param { color: var(--brand-text); }
.endpoint-desc { margin: 0 0 14px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted);
  padding: 3px 10px; border-radius: 999px; background: var(--bg-muted); border: 1px solid var(--border);
}
.chip svg { width: 13px; height: 13px; }
.chip.office { color: var(--info-text); background: var(--info-bg); border-color: var(--info-border); }
.chip.danger { color: var(--delete); background: var(--delete-bg); border-color: transparent; }
.callout {
  font-size: 14px; padding: 10px 14px; border-radius: 8px; margin: 0 0 16px;
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text);
}
.callout.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.callout ul { margin: 4px 0 0; padding-left: 18px; }

.params { margin: 22px 0 0; }
.params h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.params h4 .ct { text-transform: none; letter-spacing: 0; font-weight: 500; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-left: 6px; }
.param { padding: 11px 0; border-bottom: 1px solid var(--border); }
.param-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.param-name { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--text); }
.param-type { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.param-req { font-size: 11px; font-weight: 600; color: var(--delete); text-transform: uppercase; letter-spacing: .04em; }
.param-desc { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.param-desc p { margin: 0; }
.param-enum { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.param-enum code { font-size: 11.5px !important; }
.param-children { margin: 8px 0 0 4px; padding-left: 12px; border-left: 2px solid var(--border); }
.param-children .param { padding: 8px 0; }
.param-children .param:last-child { border-bottom: 0; }

.errors-list { margin: 0; padding: 0; list-style: none; }
.errors-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.errors-list code { flex: none; font-weight: 600; color: var(--delete) !important; }

.endpoint-code { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }

/* ---------- Home ---------- */
.hero { padding: 24px 0 36px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; line-height: 1.12; }
.hero h1 span { color: var(--brand-text); }
.hero .lead { margin-bottom: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0f0e16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0f0e16; } }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg-muted); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.card {
  display: block; padding: 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.card-title { font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card-text { font-size: 14px; color: var(--text-muted); }
.card-count { font-size: 12px; color: var(--text-faint); margin-top: 10px; font-family: var(--mono); }
.card-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); display: inline-flex; align-items: center; justify-content: center; }
.card-icon svg { width: 17px; height: 17px; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); min-width: 0; }
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager small { display: block; color: var(--text-faint); font-size: 12px; }
.pager .next { margin-left: auto; text-align: right; }

.footer { border-top: 1px solid var(--border); padding: 24px 48px; color: var(--text-faint); font-size: 13px; }

/* ---------- Search ---------- */
.search-dialog { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(10, 8, 20, .5); padding: 10vh 16px 16px; }
.search-dialog.open { display: block; }
.search-panel { max-width: 640px; margin: 0 auto; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.search-input-row svg { width: 18px; height: 18px; color: var(--text-faint); flex: none; }
.search-input { flex: 1; height: 54px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.search-results li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.search-results li a:hover, .search-results li a.sel { background: var(--brand-soft); text-decoration: none; }
.search-results .r-main { min-width: 0; }
.search-results .r-title { font-weight: 500; font-size: 14px; }
.search-results .r-sub { font-size: 12px; color: var(--text-faint); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .r-kind { margin-left: auto; font-size: 11px; color: var(--text-faint); flex: none; }
.search-empty { padding: 24px; text-align: center; color: var(--text-faint); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .endpoint { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .endpoint-code { position: static; }
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --header-h: 56px; }
  .menu-btn { display: inline-flex; }
  .header { padding: 0 16px; gap: 10px; }
  .header-nav, .env-select, .brand .tag { display: none; }
  .search-btn { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--header-h); left: 0; z-index: 30; width: min(320px, 86vw);
    transform: translateX(-100%); transition: transform .2s, box-shadow .2s; box-shadow: none;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  .content { padding: 28px 16px 64px; }
  .footer { padding: 20px 16px; }
  h1 { font-size: 28px; }
  .hero h1 { font-size: 32px; }
  .ref-index { grid-template-columns: minmax(0, 1fr); }
  .ref-index .path { display: none; }
  .pager { flex-direction: column; }
  .pager .next { margin-left: 0; }
}
