/* ========================================
   MomoBot Docs — docs.css
   ======================================== */

/* ---- Layout ---- */

.docs-body {
  background: var(--bg-primary);
  min-height: 100vh;
}

.docs-topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 60px;
  background: rgba(10, 10, 15, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.docs-topnav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 0 24px;
}

.docs-topnav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-left: 1px solid var(--border);
  padding-left: 16px;
  margin-left: 4px;
}

.docs-topnav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin-left: auto;
  min-width: 240px;
  transition: border-color 0.2s, background 0.2s;
}

.docs-topnav-search:focus-within {
  border-color: var(--accent-blue);
  background: rgba(79, 142, 247, 0.06);
}

.docs-topnav-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.docs-topnav-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  width: 100%;
}

.docs-topnav-search input::placeholder {
  color: var(--text-muted);
}

.docs-sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s, border-color 0.2s;
}

.docs-sidebar-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ---- Two-column layout ---- */

.docs-layout {
  display: flex;
  padding-top: 60px;
  min-height: 100vh;
}

.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 24px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.docs-nav {
  padding: 0 16px;
}

.docs-nav-group {
  margin-bottom: 28px;
}

.docs-nav-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.docs-nav-link {
  display: block;
  padding: 6px 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}

.docs-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.docs-nav-link.active {
  color: var(--accent-blue);
  background: rgba(79, 142, 247, 0.1);
  font-weight: 500;
}

/* ---- Content ---- */

.docs-content {
  flex: 1;
  min-width: 0;
  padding: 48px 60px 80px;
  max-width: 900px;
}

/* ---- Section ---- */

.docs-section {
  padding-top: 40px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.docs-section:last-of-type {
  border-bottom: none;
}

.docs-section-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.docs-section h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
}

.docs-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.docs-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.docs-section p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.docs-lead {
  font-size: 1.1rem;
  color: var(--text-primary) !important;
  line-height: 1.7 !important;
}

/* ---- Code ---- */

.docs-section pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #a8d8a8;
}

.docs-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--accent-cyan);
}

.docs-section pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ---- Tables ---- */

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 28px;
  font-size: 13.5px;
}

.docs-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.docs-table td {
  padding: 11px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
  line-height: 1.5;
}

.docs-table td code {
  font-size: 12px;
}

.docs-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

/* ---- Feature list ---- */

.docs-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.docs-feature-list li {
  position: relative;
  padding: 7px 0 7px 22px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.docs-feature-list li:last-child {
  border-bottom: none;
}

.docs-feature-list li::before {
  content: '›';
  position: absolute;
  left: 4px;
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
}

.docs-feature-list li strong {
  color: var(--text-primary);
}

/* ---- Ordered list ---- */

.docs-ordered-list {
  padding-left: 20px;
  margin: 0 0 24px;
}

.docs-ordered-list li {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.docs-ordered-list li strong {
  color: var(--text-primary);
}

/* ---- Cards grid ---- */

.docs-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0 28px;
}

.docs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: border-color 0.2s, background 0.2s;
}

.docs-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.docs-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.docs-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.docs-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.docs-card ul {
  padding-left: 16px;
  margin: 0;
}

.docs-card ul li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ---- Callout boxes ---- */

.docs-callout {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px 0 28px;
  font-size: 13.5px;
  line-height: 1.65;
  border-left: 3px solid;
}

.docs-callout strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
}

.docs-callout ol,
.docs-callout ul {
  margin: 8px 0 0 20px;
}

.docs-callout ol li,
.docs-callout ul li {
  margin-bottom: 4px;
}

.docs-callout-info {
  background: rgba(79, 142, 247, 0.07);
  border-color: var(--accent-blue);
  color: #9ab8f5;
}

.docs-callout-info strong {
  color: var(--accent-blue);
}

.docs-callout-warning {
  background: rgba(249, 115, 22, 0.07);
  border-color: var(--accent-orange);
  color: #f5bc9a;
}

.docs-callout-warning strong {
  color: var(--accent-orange);
}

/* ---- Steps ---- */

.docs-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin: 24px 0 36px;
}

.docs-steps::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: 40px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple));
  opacity: 0.3;
}

.docs-step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
}

.docs-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(79, 142, 247, 0.15);
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.docs-step-content {
  flex: 1;
  padding-top: 6px;
}

.docs-step-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.docs-step-content p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.65;
}

.docs-step-content ol {
  padding-left: 18px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ---- Architecture diagram ---- */

.docs-arch-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin: 24px 0 32px;
}

.arch-cloud {
  background: rgba(79, 142, 247, 0.06);
  border: 1px solid rgba(79, 142, 247, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.arch-cloud-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 12px;
  text-align: center;
}

.arch-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.arch-box {
  flex: 1;
  min-width: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.arch-box-wide {
  flex-basis: 100%;
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.arch-connector-line {
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple));
  opacity: 0.5;
}

.arch-connector-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.arch-agents {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.arch-agent {
  flex: 1;
  max-width: 200px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-green);
}

.arch-agent-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

/* ---- Flow diagram ---- */

.docs-flow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 20px 0 32px;
  gap: 0;
}

.flow-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
  width: 100%;
  transition: border-color 0.2s;
}

.flow-step:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.flow-arrow {
  color: var(--accent-blue);
  font-size: 18px;
  font-weight: 700;
  padding: 4px 20px;
  opacity: 0.6;
}

/* ---- Search highlight ---- */

.docs-search-highlight {
  background: rgba(249, 115, 22, 0.25);
  border-radius: 2px;
}

/* ---- Footer ---- */

.docs-footer {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 2;
}

.docs-footer-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.docs-footer-link:hover {
  text-decoration: underline;
}

/* ---- Back to top ---- */

.docs-back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(79, 142, 247, 0.15);
  border: 1px solid rgba(79, 142, 247, 0.4);
  color: var(--accent-blue);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, background 0.2s;
  z-index: 100;
}

.docs-back-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.docs-back-top:hover {
  background: rgba(79, 142, 247, 0.28);
}

/* ---- Search results overlay ---- */

.docs-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 380px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 300;
  display: none;
  scrollbar-width: thin;
}

.docs-search-results.open {
  display: block;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(79, 142, 247, 0.08);
}

.search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.search-result-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-no-results {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.docs-topnav-search {
  position: relative;
}

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

@media (max-width: 1024px) {
  .docs-content {
    padding: 40px 40px 60px;
  }
}

@media (max-width: 800px) {
  .docs-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .docs-topnav-search {
    min-width: 160px;
  }

  .docs-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 260px;
  }

  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.6);
  }

  .docs-content {
    padding: 32px 24px 60px;
  }

  .docs-grid-2 {
    grid-template-columns: 1fr;
  }

  .arch-agents {
    flex-direction: column;
    align-items: center;
  }

  .arch-agent {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .docs-topnav-title {
    display: none;
  }

  .docs-topnav-search {
    min-width: 120px;
  }

  .docs-section h1 {
    font-size: 1.5rem;
  }

  .docs-table {
    font-size: 12px;
  }

  .docs-table th,
  .docs-table td {
    padding: 8px 10px;
  }
}
