/* documents.simcat.org — Specific documentation styling */

/* Layout */
.docs-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
}

.docs-container {
  display: flex;
  flex: 1;
  gap: 36px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 64px 24px;
}

/* Sidebar */
.docs-sidebar {
  width: 270px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.platform-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.doc-badge {
  font-size: 11px;
  color: var(--text-muted);
}

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

.sidebar-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.nav-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.nav-entry:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

.nav-entry.active {
  background: rgba(79, 140, 246, 0.16);
  color: var(--primary-hover);
  font-weight: 600;
  border: 1px solid rgba(79, 140, 246, 0.3);
}

.entry-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  line-height: 1.4;
}

.toc-item.toc-sub {
  padding-left: 20px;
  font-size: 12px;
}

.toc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.toc-item:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.toc-item.active-target {
  color: var(--accent-cyan);
  background: rgba(56, 214, 223, 0.12);
  font-weight: 600;
}

.toc-item.active-target .toc-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.btn-back-home {
  display: inline-block;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 12px;
  transition: color 0.2s;
}

.btn-back-home:hover {
  color: var(--primary-hover);
}

/* Content Area */
.docs-content {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 44px;
  box-shadow: var(--shadow-card);
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.docs-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--primary-hover);
}

.docs-breadcrumb .current {
  color: var(--text-main);
  font-weight: 500;
}

.docs-breadcrumb .anchor-tag {
  background: rgba(56, 214, 223, 0.15);
  color: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Markdown typography */
.markdown-body {
  font-size: 14.5px;
  line-height: 1.75;
}

.doc-heading {
  position: relative;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 32px;
  margin-bottom: 14px;
  scroll-margin-top: 90px;
}

.doc-h1 {
  font-size: 26px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-top: 0;
}

.doc-h2 {
  font-size: 19px;
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-h3 {
  font-size: 16px;
}

.heading-anchor {
  position: absolute;
  left: -20px;
  color: var(--text-dim);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s;
  font-weight: normal;
}

.doc-heading:hover .heading-anchor {
  opacity: 1;
}

/* Target Solution Highlight */
.doc-heading.target-highlight {
  background: rgba(255, 170, 50, 0.12);
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 28px;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.target-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #f59e0b;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 12px;
  vertical-align: middle;
}

.doc-p {
  margin-bottom: 14px;
  color: var(--text-main);
}

.doc-list {
  margin-bottom: 18px;
  padding-left: 24px;
}

.doc-list li {
  margin-bottom: 8px;
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
}

.code-block {
  background: rgba(5, 7, 12, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 18px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #e2e8f0;
}

.doc-quote {
  border-left: 3px solid var(--primary);
  background: rgba(79, 140, 246, 0.08);
  padding: 12px 18px;
  margin: 18px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}

.doc-link {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 32px 0;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.doc-table th, .doc-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.doc-table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

/* Help Box */
.docs-help-box {
  margin-top: 48px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(42, 171, 238, 0.08);
  border: 1px solid rgba(42, 171, 238, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.help-box-content h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: var(--text-main);
}

.help-box-content p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-join-tg {
  display: inline-flex;
  align-items: center;
  background: var(--tg-blue);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px var(--tg-glow);
  transition: transform 0.2s, background 0.2s;
}

.btn-join-tg:hover {
  background: var(--tg-blue-hover);
  transform: translateY(-1px);
}

/* Footer */
.docs-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Responsive */
@media (max-width: 860px) {
  .docs-container {
    flex-direction: column;
    padding: 16px 12px;
  }
  .docs-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    margin-bottom: 20px;
  }
  .docs-content {
    padding: 24px 18px;
  }
  .docs-help-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Code Copy Button */
.btn-code-copy {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.btn-code-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-code-copy.copied {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

