/* ========================================
   NOSTIOS DOCS — Documentation System Styles
   ======================================== */

/* Docs pages use a wider container */
.docs-hub-header .container,
.docs-hub-search .container,
.docs-hub-header + .section .container,
.docs-breadcrumbs .container,
.docs-header .container,
.docs-search-bar .container,
.docs-layout .container {
  max-width: 1280px;
}

/* ---- Docs Hub ---- */
.docs-hub-header { padding-bottom: 40px; }

.docs-hub-search {
  padding: 0 0 56px;
}
.docs-hub-search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}
.docs-hub-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px 18px 50px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.docs-hub-search-input::placeholder { color: var(--text-muted); }
.docs-hub-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.docs-hub-search-wrap .docs-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.docs-hub-search-wrap .docs-search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  pointer-events: none;
}

/* Hub app cards grid */
.docs-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 72px;
}
.docs-hub-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.docs-hub-card p {
  flex: 1;
}

/* Quick links */
.docs-hub-quicklinks {
  margin-bottom: 72px;
}
.docs-hub-quicklinks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.docs-quicklink-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  text-decoration: none;
  color: inherit;
}
.docs-quicklink-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.docs-quicklink-icon svg {
  width: 24px;
  height: 24px;
}
.docs-quicklink-text {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Hub CTA */
.docs-hub-cta {
  padding-top: 16px;
}

@media (max-width: 800px) {
  .docs-hub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .docs-hub-quicklinks-grid { grid-template-columns: 1fr; }
}

/* ---- Docs Breadcrumbs ---- */
.docs-breadcrumbs {
  padding: 96px 0 0;
}
.docs-breadcrumb-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-muted);
}
.docs-breadcrumb-list li + li::before {
  content: '/';
  margin-right: 8px;
  color: var(--border);
}
.docs-breadcrumb-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.docs-breadcrumb-list a:hover {
  color: var(--accent);
}
.docs-breadcrumb-list [aria-current="page"] {
  color: var(--text-secondary);
}

/* ---- Docs Header ---- */
.docs-header {
  padding: 20px 0 16px;
}
.docs-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 24px;
  position: relative;
  overflow: hidden;
}
.docs-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.6;
}
.docs-header-card--resonance::before { background: var(--blue); }
.docs-header-card--block-tower::before { background: var(--warm); }
.docs-header-card--trap-the-dot::before { background: #e06c8a; }
.docs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.docs-header-info {
  display: flex;
  align-items: center;
  gap: 20px;
}
.docs-header-info .app-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.docs-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}
.docs-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.docs-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.docs-version,
.docs-platform {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(91, 84, 235, 0.1);
  color: var(--accent);
  border: 1px solid rgba(91, 84, 235, 0.2);
}

/* ---- Docs Search Bar (inline in content) ---- */
.docs-search-bar {
  margin-bottom: 32px;
}
.docs-search-bar .container {
  max-width: none;
  padding: 0;
}
.docs-search-input-wrap {
  position: relative;
}
.docs-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.docs-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px 14px 44px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.docs-search-input::placeholder { color: var(--text-muted); }
.docs-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.docs-search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  pointer-events: none;
}

/* Search results dropdown */
.docs-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-width: 480px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 60;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-light) transparent;
}
.docs-hub-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 60;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-light) transparent;
}
.docs-search-result {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
  cursor: pointer;
}
.docs-search-result:last-child { border-bottom: none; }
.docs-search-result:hover,
.docs-search-result.focused {
  background: rgba(91, 84, 235, 0.1);
}
.docs-search-result-section {
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.docs-search-result-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 2px;
}
.docs-search-result-snippet {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.docs-search-result-snippet mark {
  background: rgba(91, 84, 235, 0.3);
  color: var(--text-primary);
  border-radius: 2px;
  padding: 0 2px;
}
.docs-search-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---- Docs Layout (Two-Column) ---- */
.docs-layout {
  padding: 0 0 40px;
}
.docs-layout-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---- Docs Sidebar ---- */
.docs-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-light) transparent;
}
.docs-sidebar-group {
  margin-bottom: 6px;
}
.docs-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}
.docs-sidebar-heading:hover {
  color: var(--text-primary);
}
.docs-sidebar-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.docs-sidebar-heading[aria-expanded="false"] .docs-sidebar-chevron {
  transform: rotate(-90deg);
}
.docs-sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.docs-sidebar-heading[aria-expanded="false"] + .docs-sidebar-links {
  max-height: 0 !important;
  margin-bottom: 0;
}
.docs-sidebar-link {
  display: block;
  padding: 6px 0 6px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  border-radius: 0 4px 4px 0;
}
.docs-sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}
.docs-sidebar-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(91, 84, 235, 0.06);
}

/* Sidebar toggle (mobile) */
.docs-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}
.docs-sidebar-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* ---- Docs Content ---- */
.docs-content {
  min-width: 0;
}
.docs-section {
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.docs-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.docs-section h2 {
  font-family: var(--font-heading);
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  scroll-margin-top: 140px;
}
.docs-section h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 14px;
  scroll-margin-top: 140px;
}
.docs-section h3:first-child { margin-top: 0; }
.docs-section p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}
.docs-section p:last-child { margin-bottom: 0; }
.docs-section a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
.docs-section a:hover { color: var(--text-primary); }
.docs-section ul,
.docs-section ol {
  padding-left: 0;
  list-style: none;
  margin: 16px 0 20px;
}
.docs-section li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 6px 0 6px 22px;
  position: relative;
}
.docs-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}
.docs-section ol:not(.docs-steps) {
  counter-reset: docs-ol;
}
.docs-section ol:not(.docs-steps) li {
  counter-increment: docs-ol;
}
.docs-section ol:not(.docs-steps) li::before {
  content: counter(docs-ol) '.';
  position: absolute;
  left: 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.docs-inline-icon {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.docs-section li strong {
  color: var(--text-primary);
  font-weight: 500;
}
.docs-section img {
  border-radius: 12px;
  margin: 16px 0;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ---- Docs TOC (Right) — hidden, sidebar is primary nav ---- */
.docs-toc {
  display: none;
}

/* ---- Docs Callouts ---- */
.docs-callout {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 12px;
  margin: 24px 0;
  border: 1px solid;
}
.docs-callout-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.docs-callout-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.docs-callout-body p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0;
}

.docs-callout--info {
  background: rgba(91, 168, 245, 0.06);
  border-color: rgba(91, 168, 245, 0.15);
}
.docs-callout--info .docs-callout-icon { color: var(--blue); }
.docs-callout--info .docs-callout-title { color: var(--blue); }

.docs-callout--tip {
  background: rgba(78, 205, 196, 0.06);
  border-color: rgba(78, 205, 196, 0.15);
}
.docs-callout--tip .docs-callout-icon { color: var(--teal); }
.docs-callout--tip .docs-callout-title { color: var(--teal); }

.docs-callout--warning {
  background: rgba(240, 168, 94, 0.06);
  border-color: rgba(240, 168, 94, 0.15);
}
.docs-callout--warning .docs-callout-icon { color: var(--warm); }
.docs-callout--warning .docs-callout-title { color: var(--warm); }

.docs-callout--note {
  background: rgba(91, 84, 235, 0.06);
  border-color: rgba(91, 84, 235, 0.15);
}
.docs-callout--note .docs-callout-icon { color: var(--accent); }
.docs-callout--note .docs-callout-title { color: var(--accent); }

/* ---- Docs Steps ---- */
.docs-steps {
  list-style: none;
  padding-left: 0;
  margin: 20px 0;
}
.docs-step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.docs-step:last-child { border-bottom: none; }
.docs-step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-glow);
}
.docs-step-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.docs-step-body p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0;
}

/* ---- Docs Tabs ---- */
.docs-tabs {
  margin: 20px 0;
}
.docs-tab-list {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.docs-tab {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.docs-tab:hover { color: var(--text-primary); }
.docs-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.docs-tab-panel { display: none; }
.docs-tab-panel.active { display: block; }
.docs-tab-panel p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ---- Docs Code Blocks ---- */
.docs-code-block {
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--deep);
}
.docs-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.docs-code-lang {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.docs-code-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.docs-code-copy:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}
.docs-code-copy.copied {
  color: var(--teal);
}
.docs-code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-light) transparent;
}
.docs-code code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Inline code */
.docs-section code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: rgba(91, 84, 235, 0.1);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(91, 84, 235, 0.15);
}
.docs-code-block code {
  background: none;
  color: var(--text-secondary);
  padding: 0;
  border: none;
  border-radius: 0;
}

/* ---- Docs Details / Collapsible ---- */
.docs-details {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.docs-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  background: rgba(255,255,255,0.02);
  transition: background 0.2s;
  list-style: none;
}
.docs-details-summary::-webkit-details-marker { display: none; }
.docs-details-summary::marker { display: none; content: ''; }
.docs-details-summary:hover {
  background: rgba(255,255,255,0.04);
}
.docs-details-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}
.docs-details[open] .docs-details-chevron {
  transform: rotate(180deg);
}
.docs-details-body {
  padding: 0 18px 18px;
}
.docs-details-body p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-top: 4px;
}

/* ---- Docs Footer Nav ---- */
.docs-footer-nav-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
}
.docs-footer-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  padding: 16px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
  min-width: 180px;
}
.docs-footer-nav-link:hover {
  border-color: var(--accent);
  background: rgba(91, 84, 235, 0.04);
}
.docs-footer-nav-link--next {
  text-align: right;
  margin-left: auto;
}
.docs-footer-nav-dir {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.docs-footer-nav-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}

/* ---- Docs Responsive ---- */

/* Mobile: sidebar becomes drawer */
@media (max-width: 800px) {
  .docs-layout-inner {
    grid-template-columns: 1fr;
  }

  .docs-header-card {
    padding: 24px 20px;
  }

  .docs-sidebar-toggle {
    display: flex;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-height: 100vh;
    background: linear-gradient(180deg, var(--deep) 0%, var(--void) 100%);
    border-right: 1px solid var(--border);
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 80px 24px 24px;
    overflow-y: auto;
  }

  .docs-sidebar.docs-sidebar--open {
    transform: translateX(0);
  }

  body.docs-sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.7);
    z-index: 85;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .docs-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .docs-footer-nav-inner {
    flex-direction: column;
  }
  .docs-footer-nav-link {
    min-width: 0;
  }
  .docs-footer-nav-link--next {
    text-align: left;
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .docs-breadcrumbs { padding-top: 76px; }
  .docs-title { font-size: 1.5rem; }
  .docs-section h2 { font-size: 1.25rem; }
  .docs-section h3 { font-size: 1rem; }
  .docs-callout { flex-direction: column; gap: 8px; }
  .docs-step { gap: 14px; }
}

/* Prevent body scroll when sidebar open */
body.docs-sidebar-open {
  overflow: hidden;
}
