/* ===== DOCS THEME ===== */

.docs-page {
  background: #f8f9fa;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.docs-page .nav {
  background: #050508;
}

/* ===== LAYOUT ===== */

.docs-layout {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding-top: 80px; /* nav height */
}

/* ===== SIDEBAR ===== */

.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  background: #fff;
}

.docs-sidebar-inner {
  position: sticky;
  top: 80px;
  padding: 24px 16px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.docs-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: border-color 0.15s;
}

.docs-search-trigger:hover {
  border-color: #4a90d9;
}

.docs-search-trigger kbd {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 6px;
  background: #e5e7eb;
  border-radius: 4px;
  font-family: inherit;
}

.docs-sidebar-section {
  margin-bottom: 20px;
}

.docs-sidebar-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0 0 8px 0;
  padding: 0 8px;
}

.docs-sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-sidebar-link {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.docs-sidebar-link:hover {
  background: #f3f4f6;
  color: #111827;
}

.docs-sidebar-link.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 500;
}

/* ===== MAIN CONTENT ===== */

.docs-main {
  flex: 1;
  min-width: 0;
  padding: 32px 48px;
}

/* ===== BREADCRUMBS ===== */

.docs-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 24px;
}

.docs-breadcrumbs a {
  color: #6b7280;
  text-decoration: none;
}

.docs-breadcrumbs a:hover {
  color: #2563eb;
}

.docs-breadcrumb-sep {
  color: #d1d5db;
}

/* ===== ARTICLE TYPOGRAPHY ===== */

.docs-content h1 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.docs-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin: 40px 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.3;
}

.docs-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 32px 0 12px 0;
  line-height: 1.4;
}

.docs-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 24px 0 8px 0;
}

.docs-content p {
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
  margin: 0 0 16px 0;
}

.docs-content a {
  color: #2563eb;
  text-decoration: none;
}

.docs-content a:hover {
  text-decoration: underline;
}

.docs-content ul, .docs-content ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.docs-content li {
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 4px;
}

.docs-content strong {
  font-weight: 600;
  color: #111827;
}

.docs-content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 6px;
  color: #1f2937;
}

.docs-content pre {
  background: #0a0a14;
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 0 0 20px 0;
}

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.6;
}

.docs-content blockquote {
  border-left: 3px solid #4a90d9;
  margin: 0 0 16px 0;
  padding: 12px 20px;
  background: #eff6ff;
  border-radius: 0 8px 8px 0;
}

.docs-content blockquote p {
  color: #1e40af;
  margin: 0;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px 0;
  font-size: 14px;
}

.docs-content th {
  background: #f3f4f6;
  font-weight: 600;
  text-align: left;
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.docs-content td {
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  color: #4b5563;
}

.docs-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 32px 0;
}

/* ===== LIVE EXAMPLE CONTAINERS ===== */

.docs-example {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin: 0 0 20px 0;
  background: #fff;
}

.docs-example-dark {
  background: #0a0a14;
  border-color: #1a1a2e;
}

/* ===== WORKFLOW NODE STYLES ===== */

.docs-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 0 0 20px 0;
}

.docs-node {
  padding: 12px 16px;
  border-radius: 8px;
  background: white;
  border: 2px solid #e5e7eb;
  min-width: 150px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.docs-node:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.docs-node-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.docs-node-info {
  flex: 1;
  min-width: 0;
}

.docs-node-title {
  font-weight: 600;
  font-size: 13px;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-node-subtitle {
  font-size: 11px;
  color: #6b7280;
  text-transform: capitalize;
}

/* Node type variants */
.docs-node-trigger { border-color: #10b981; background: linear-gradient(to bottom, #ecfdf5, white); }
.docs-node-action { border-color: #3b82f6; background: linear-gradient(to bottom, #eff6ff, white); }
.docs-node-condition { border-color: #f59e0b; background: linear-gradient(to bottom, #fffbeb, white); }
.docs-node-router { border-color: #8b5cf6; background: linear-gradient(to bottom, #f5f3ff, white); }
.docs-node-merge { border-color: #a855f7; background: linear-gradient(to bottom, #faf5ff, white); }
.docs-node-loop { border-color: #ec4899; background: linear-gradient(to bottom, #fdf2f8, white); }
.docs-node-subworkflow { border-color: #6366f1; background: linear-gradient(to bottom, #eef2ff, white); }
.docs-node-approval { border-color: #f97316; background: linear-gradient(to bottom, #fff7ed, white); }
.docs-node-delivery { border-color: #14b8a6; background: linear-gradient(to bottom, #f0fdfa, white); }

/* ===== TABLE OF CONTENTS ===== */

.docs-toc {
  width: 220px;
  flex-shrink: 0;
}

.docs-toc-inner {
  position: sticky;
  top: 80px;
  padding: 32px 16px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.docs-toc-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0 0 12px 0;
}

.docs-toc .toc {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-toc .toc li {
  margin: 0;
}

.docs-toc .toc a {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.15s, border-color 0.15s;
}

.docs-toc .toc a:hover {
  color: #2563eb;
  border-left-color: #2563eb;
}

.docs-toc .toc .toc {
  padding-left: 12px;
}

/* ===== PAGINATION ===== */

.docs-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.docs-pagination-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  max-width: 45%;
  transition: border-color 0.15s;
}

.docs-pagination-link:hover {
  border-color: #2563eb;
}

.docs-pagination-dir {
  font-size: 12px;
  color: #6b7280;
}

.docs-pagination-title {
  font-size: 14px;
  font-weight: 500;
  color: #2563eb;
}

.docs-pagination-next {
  text-align: right;
  margin-left: auto;
}

/* ===== SEARCH OVERLAY ===== */

.docs-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.docs-search-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.docs-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  color: #6b7280;
}

.docs-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #111827;
  background: transparent;
  font-family: inherit;
}

.docs-search-input::placeholder {
  color: #9ca3af;
}

.docs-search-esc {
  font-size: 11px;
  padding: 2px 6px;
  background: #f3f4f6;
  border-radius: 4px;
  color: #6b7280;
  font-family: inherit;
}

.docs-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.docs-search-empty {
  padding: 24px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.docs-search-result {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.1s;
}

.docs-search-result:hover {
  background: #f3f4f6;
}

.docs-search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.docs-search-result-section {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.docs-search-result-snippet {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
  .docs-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .docs-sidebar {
    display: none;
  }

  .docs-main {
    padding: 24px 20px;
  }

  .docs-content h1 {
    font-size: 26px;
  }

  .docs-content h2 {
    font-size: 20px;
  }

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

  .docs-search-overlay {
    padding-top: 60px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
