/* Modern Dark Design System for Self-Hosted 3X-UI Documentation */

.docs-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* Header */
.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  margin-bottom: 28px;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary, #ffffff);
  font-size: 1.25rem;
  font-weight: 700;
}

.docs-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.docs-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--card-bg, #1a1f2c);
  color: var(--text-primary, #ffffff);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-nav-back:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-nav-back.checker-btn:hover {
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 8px;
}

.sidebar-block {
  background: var(--card-bg, #161b26);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 16px;
}

.sidebar-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary, #cbd5e1);
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-weight: 600;
  border-left: 3px solid #3b82f6;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-link {
  font-size: 0.8125rem;
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  line-height: 1.4;
  padding: 3px 0;
  transition: color 0.15s ease;
}

.toc-link:hover {
  color: #60a5fa;
}

.toc-level-3 {
  padding-left: 12px;
  font-size: 0.75rem;
  opacity: 0.85;
}

/* Article Styling */
.doc-article {
  background: var(--card-bg, #161b26);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 36px 40px;
  line-height: 1.7;
  color: #e2e8f0;
}

.doc-article h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-article h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 36px;
  margin-bottom: 16px;
  position: relative;
  scroll-margin-top: 80px;
}

.doc-article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 24px;
  margin-bottom: 12px;
  scroll-margin-top: 80px;
}

.header-anchor {
  color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
  font-size: 0.9em;
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.doc-article h2:hover .header-anchor,
.doc-article h3:hover .header-anchor {
  opacity: 1;
}

.doc-article p {
  margin-bottom: 16px;
}

.doc-article ul, .doc-article ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

.doc-article li {
  margin-bottom: 6px;
}

.doc-article a {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-article a:hover {
  color: #93c5fd;
}

.doc-article code {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  color: #38bdf8;
}

.doc-article pre {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.doc-article pre code {
  background: transparent;
  padding: 0;
  color: #e6edf3;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Tables */
.doc-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.doc-article th, .doc-article td {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.doc-article th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  color: #ffffff;
}

.doc-article tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Callouts / Alerts */
.doc-alert {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
  border-left: 4px solid;
}

.doc-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.doc-alert-note {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}
.doc-alert-note .doc-alert-header { color: #60a5fa; }

.doc-alert-tip {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
}
.doc-alert-tip .doc-alert-header { color: #34d399; }

.doc-alert-important {
  background: rgba(139, 92, 246, 0.1);
  border-color: #8b5cf6;
}
.doc-alert-important .doc-alert-header { color: #a78bfa; }

.doc-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
}
.doc-alert-warning .doc-alert-header { color: #fbbf24; }

.doc-alert-caution {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}
.doc-alert-caution .doc-alert-header { color: #f87171; }

.doc-alert-body p:last-child {
  margin-bottom: 0;
}

/* Footer Nav */
.doc-footer-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 16px;
}

.footer-nav-btn {
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--card-bg, #161b26);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-primary, #ffffff);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.footer-nav-btn.accent {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

.footer-nav-btn.accent:hover {
  background: #2563eb;
}

/* Catalog Index Page */
.docs-hero {
  text-align: center;
  max-width: 760px;
  margin: 20px auto 44px;
}

.docs-hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
}

.docs-hero-sub {
  font-size: 1.0625rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.6;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.doc-card-item {
  background: var(--card-bg, #161b26);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.doc-card-item:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.doc-card-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.doc-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.doc-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}

.doc-card-action {
  font-size: 0.875rem;
  font-weight: 700;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Responsive */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
  }
  .doc-article {
    padding: 24px 20px;
  }
  .docs-hero-title {
    font-size: 1.75rem;
  }
  .docs-grid {
    grid-template-columns: 1fr;
  }
}
