/* Documentation Layout — adapted from xplorer, premium theme */

:root {
  --docs-sidebar-width: 280px;
  --docs-sidebar-bg: #f9fafb;
  --docs-sidebar-border: #e5e7eb;
  --docs-nav-active-bg: #dbeafe;
  --docs-nav-active-text: #2563eb;
  --docs-nav-hover-bg: #f3f4f6;
}

[data-bs-theme="dark"] {
  --docs-sidebar-bg: #1e293b;
  --docs-sidebar-border: #334155;
  --docs-nav-active-bg: #1e3a5f;
  --docs-nav-active-text: #60a5fa;
  --docs-nav-hover-bg: #334155;
}

.docs-container {
  display: flex;
  min-height: calc(100vh - 56px);
}

.docs-sidebar {
  width: var(--docs-sidebar-width);
  background-color: var(--docs-sidebar-bg);
  border-right: 1px solid var(--docs-sidebar-border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-content {
  padding: 1.5rem 1rem;
}

.sidebar-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--docs-sidebar-border);
}

.sidebar-header h5 {
  margin: 0;
  font-weight: 700;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bs-secondary);
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
  letter-spacing: 0.08em;
}

.docs-sidebar .nav-link {
  color: var(--bs-body-color);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 0.125rem;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.docs-sidebar .nav-link:hover {
  background-color: var(--docs-nav-hover-bg);
  color: var(--docs-nav-active-text);
}

.docs-sidebar .nav-link.active {
  background-color: var(--docs-nav-active-bg);
  color: var(--docs-nav-active-text);
  font-weight: 600;
}

.docs-sidebar .nav-link i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

.docs-content {
  flex: 1;
  overflow-y: auto;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* Content typography */
.docs-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--docs-sidebar-border);
}

.docs-content h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.docs-content h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.docs-content p { line-height: 1.8; margin-bottom: 1rem; }
.docs-content ul, .docs-content ol { line-height: 1.8; margin-bottom: 1rem; padding-left: 1.5rem; }
.docs-content li { margin-bottom: 0.375rem; }

.docs-content code {
  background-color: var(--bs-secondary-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.docs-content pre {
  background-color: var(--bs-secondary-bg);
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.docs-content pre code {
  background-color: transparent;
  padding: 0;
}

.docs-content table { width: 100%; margin-bottom: 1.5rem; border-collapse: collapse; }
.docs-content th, .docs-content td { padding: 0.75rem; border: 1px solid var(--docs-sidebar-border); }
.docs-content th { background-color: var(--docs-sidebar-bg); font-weight: 600; }

.docs-content blockquote {
  border-left: 4px solid var(--docs-nav-active-text);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--bs-secondary);
}

.docs-content a { color: var(--docs-nav-active-text); text-decoration: none; }
.docs-content a:hover { text-decoration: underline; }

.docs-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
  display: block;
}

/* Responsive */
@media (max-width: 992px) {
  .docs-sidebar {
    position: fixed;
    left: -100%;
    top: 56px;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }
  .docs-sidebar.show { left: 0; }
  .content-wrapper { padding: 1.5rem 1rem; }
}

.sidebar-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1001;
  display: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--docs-nav-active-text);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  align-items: center;
  justify-content: center;
}

@media (max-width: 992px) {
  .sidebar-toggle { display: flex; }
}

/* Scrollbar */
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-track { background: var(--docs-sidebar-bg); }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--docs-sidebar-border); border-radius: 3px; }
