/* ═══════════════════════════════════════════════════════════
   ZENTIQ DEVELOPER DOCS & API REFERENCE — STYLES
   ═══════════════════════════════════════════════════════════ */

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

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

:root {
  --bg-deep:        #080808;
  --bg-surface:     #0c0c0c;
  --bg-card:        #121212;
  --bg-card-hover:  #181818;
  --bg-code:        #060606;
  --border:         rgba(255, 255, 255, 0.08);
  --border-hover:   rgba(255, 255, 255, 0.16);
  --accent-green:   #00f0ff;
  --accent-blue:    #a855f7;
  --accent-violet:  #a78bfa;
  --accent-warm:    #fbbf24;
  --accent-cyan:    #22d3ee;
  --accent-red:     #f87171;
  --text-primary:   #f5f5f5;
  --text-secondary: #909095;
  --text-muted:     #525258;
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-xl:      24px;
  --font-sans:      'Inter', system-ui, sans-serif;
  --font-display:   'Syne', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
  --nav-height:     65px;
  --sidebar-w:      270px;
  --toc-w:          220px;
  --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 70% 30% at 50% 0%, rgba(0, 240, 255, 0.04) 0%, transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, 0.01) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 100% 100%, 64px 64px, 64px 64px;
}

/* ── NAV ── */

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #080808; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #00f0ff, #a855f7, #ec4899); border-radius: 8px; border: 2px solid #080808; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #38bdf8, #c084fc, #f472b6); }
html { scrollbar-width: thin; scrollbar-color: #a855f7 #080808; }

.docs-nav {
  position: fixed;
  top: 0; left: 0; width: 100%;
  height: var(--nav-height);
  z-index: 200;
  background: rgba(8, 8, 8, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 36px);
}

.docs-nav__left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.docs-nav__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-nav__badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 2px 7px;
  border-radius: 100px;
}

/* Search Trigger Bar */
.docs-search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 220px;
}
.docs-search-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.docs-search-btn kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.docs-nav__links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.docs-nav__link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.docs-nav__link:hover { color: var(--text-primary); }

.docs-nav__cta {
  background: var(--accent-green);
  color: #000;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform var(--transition);
}
.docs-nav__cta:hover { transform: translateY(-1px); }

/* ── LAYOUT ── */
.docs-layout {
  display: flex;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ── LEFT SIDEBAR ── */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--nav-height);
  bottom: 0;
  left: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 16px 40px;
  z-index: 50;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 8px;
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-green);
  font-weight: 600;
}

.badge-method {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}
.badge-method--post { background: rgba(0, 240, 255, 0.15); color: var(--accent-green); }
.badge-method--get  { background: rgba(168, 85, 247, 0.15); color: var(--accent-blue); }
.badge-method--wss  { background: rgba(167, 139, 250, 0.15); color: var(--accent-violet); }

/* ── MAIN CONTENT ── */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-right: var(--toc-w);
  padding: 44px clamp(20px, 4vw, 56px) 80px;
  max-width: 900px;
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.docs-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.15;
}

.docs-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
}

/* Sections */
.docs-section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--nav-height) + 32px);
}

.section-h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.docs-p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 18px;
}

/* Callout Box */
.docs-callout {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.docs-callout.info {
  background: rgba(168, 85, 247, 0.05);
  border-color: rgba(168, 85, 247, 0.2);
  border-left-color: var(--accent-blue);
}

.callout-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.callout-content { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.callout-content strong { color: var(--text-primary); }

/* ── CODE BLOCKS ── */
.code-box {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 20px 0 28px;
  overflow: hidden;
}

.code-box__header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-tabs {
  display: flex;
  gap: 4px;
}

.code-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}
.code-tab:hover { color: var(--text-primary); }
.code-tab.active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent-green);
}

.btn-copy-code {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-family: var(--font-sans);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition);
}
.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.code-content {
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.code-content pre { margin: 0; }

/* Syntax Tokens */
.tok-kw  { color: #c084fc; font-weight: 600; } /* keyword */
.tok-fn  { color: #a855f7; } /* function */
.tok-str { color: #00f0ff; } /* string */
.tok-num { color: #f59e0b; } /* number */
.tok-cmt { color: #52525b; font-style: italic; } /* comment */
.tok-typ { color: #38bdf8; } /* type */

/* ── PARAMETER TABLE ── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.82rem;
}

.param-table th {
  background: var(--bg-card);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.param-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--bg-surface);
}
.param-table tr:last-child td { border-bottom: none; }

.param-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.param-type {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-violet);
  background: rgba(167, 139, 250, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.param-req {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-red);
  text-transform: uppercase;
}
.param-opt {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── API PLAYGROUND ── */
.playground-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  position: relative;
}

.playground-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.playground-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.playground-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-control {
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}
.input-control:focus {
  border-color: var(--accent-green);
}

.btn-send-req {
  background: linear-gradient(135deg, var(--accent-green), #78e86c);
  color: #000;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.btn-send-req:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 240, 255, 0.25);
}

.playground-output {
  margin-top: 18px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #a3e635;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ── RIGHT TOC ── */
.docs-toc {
  width: var(--toc-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--nav-height);
  bottom: 0;
  right: 0;
  padding: 32px 20px 40px;
  overflow-y: auto;
}

.toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-link {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
  display: block;
  line-height: 1.4;
}
.toc-link:hover, .toc-link.active {
  color: var(--accent-green);
}

/* ── SEARCH MODAL ── */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.search-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 0.2s ease;
}

.search-modal-overlay.open .search-modal {
  transform: translateY(0);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
}

.search-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}

.search-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
}
.search-item:hover, .search-item.highlight {
  background: rgba(255, 255, 255, 0.05);
}

.search-item__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-item__snippet {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .docs-toc { display: none; }
  .docs-main { margin-right: 0; }
}

@media (max-width: 860px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }
  .docs-main {
    margin-left: 0;
    padding: 30px 20px;
  }
  .playground-inputs {
    grid-template-columns: 1fr;
  }
  .docs-nav__links {
    display: none;
  }
}
