/* Docs Tab Styles */

#docs-sidebar {
  width: 20vw;
  background:
    radial-gradient(900px 700px at 15% 4%,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.03) 35%,
      rgba(255, 255, 255, 0.00) 60%),
    linear-gradient(140deg,
      var(--sb-1) 0%,
      var(--sb-2) 28%,
      var(--sb-3) 58%,
      var(--sb-4) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -40px 60px rgba(0, 0, 0, 0.18),
    6px 0 14px rgba(0, 0, 0, 0.35);
  height: 100vh;
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

#docs-sidebar header {
  padding: 15px;
  padding-top: 7px;
  padding-bottom: 0;
  background-color: transparent;
  color: white;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

#docs-sidebar header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: none;
  margin-top: 22px;
  margin-bottom: 24px;
  color: #ffffff;
}

#docs-sidebar header h2.sidebar-header-title {
  margin-top: 22px !important;
  margin-bottom: 24px !important;
}

#docs-tree {
  flex: 1;
  overflow: visible;
  padding: 0 8px 0 8px;
}

.docs-tree-list,
.docs-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-tree-children {
  padding-left: 18px;
}

.docs-tree-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  margin-top: 8px;
  padding: 3px 6px;
  position: relative;
}

.docs-tree-item.active {
  background: rgba(242, 243, 244, 0.95);
}

.docs-tree-toggle,
.docs-pagination-btn {
  border: none;
  background: transparent;
  cursor: pointer;
}

.docs-tree-toggle {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.docs-tree-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.docs-tree-toggle-spacer {
  width: 30px;
  flex: 0 0 auto;
}

.docs-tree-select {
  border: none;
  background: transparent;
  color: inherit;
  padding: 8px 0;
  cursor: pointer;
  text-align: left;
  flex: 1;
  min-width: 0;
  font-family: 'Inter', sans-serif;
}

.docs-tree-title {
  display: block;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-tree-item.active .docs-tree-title {
  color: #2c3e50;
}

.docs-tree-item.active .docs-tree-toggle {
  color: #2c3e50;
}

.docs-tree-item.active .docs-tree-toggle .lucide-icon {
  color: #2c3e50;
  stroke: #2c3e50;
}

#docs-details {
  flex: 1;
  min-width: 0;
  height: 95.2vh;
  background: #f7f8fa;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.docs-content-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 15px 0 0 0;
  box-sizing: border-box;
}

.docs-reader-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.docs-reader-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 10px 0;
  border-bottom: 1.8px solid #ddd;
  margin: 0;
  width: 100%;
  flex: 0 0 auto;
}

.docs-reader-title {
  margin: 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
  padding-left: 15px;
}

.docs-reader-subtitle {
  margin-top: 6px;
  padding-left: 15px;
  color: #6b778c;
  font-size: 0.85rem;
}

.docs-reader-pagination {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  padding-right: 12px;
}

.docs-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: #33D391;
  color: #ffffff;
  font-weight: 500;
  font-size: 13px;
  min-height: 36px;
  letter-spacing: -0.01em;
  font-family: 'Figtree', sans-serif;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 4px rgba(51, 211, 145, 0.2);
}

.docs-pagination-btn:hover:not(:disabled) {
  background: #2ecc71;
  color: #ffffff;
}

.docs-pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.docs-pagination-btn .lucide-icon {
  color: #ffffff;
  stroke: #ffffff;
}

.docs-reader-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 0 72px 0;
  color: #243043;
  line-height: 1.55;
  box-sizing: border-box;
  font-size: 1rem;
}

.docs-reader-body::-webkit-scrollbar {
  width: 8px;
}

.docs-reader-body::-webkit-scrollbar-track {
  background-color: #f4f6f8;
}

.docs-reader-body::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
}

.docs-reader-body::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

.docs-reader-body > * {
  padding-left: 28px;
  padding-right: 20px;
}

.docs-reader-body > *:last-child {
  margin-bottom: 0;
}

.docs-reader-body h1,
.docs-reader-body h2,
.docs-reader-body h3,
.docs-reader-body h4 {
  color: #1f2a44;
  line-height: 1.35;
  margin-top: 1em;
  margin-bottom: 0.35em;
}

.docs-reader-body h1 {
  font-size: 1.6rem;
  font-weight: 600;
}

.docs-reader-body h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

.docs-reader-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.docs-reader-body h4 {
  font-size: 1rem;
  font-weight: 600;
}

.docs-reader-body h1:first-child,
.docs-reader-body h2:first-child,
.docs-reader-body h3:first-child,
.docs-reader-body h4:first-child,
.docs-reader-body p:first-child {
  margin-top: 0;
}

.docs-reader-body p,
.docs-reader-body ul,
.docs-reader-body ol,
.docs-reader-body blockquote {
  margin: 0 0 0.75em;
}

.docs-reader-body ul,
.docs-reader-body ol {
  padding-left: calc(28px + 1.5rem);
}

.docs-reader-body li {
  margin-bottom: 0.3em;
}

.docs-reader-body li:last-child {
  margin-bottom: 0;
}

.docs-reader-body a {
  color: #1b74d8;
}

.docs-reader-body code {
  background: #f4f6fb;
  border-radius: 6px;
  padding: 0.15em 0.4em;
}

.docs-reader-body pre {
  background: #f4f6fb;
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
}

.docs-empty-state,
.docs-error-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #676879;
  padding: 40px;
}

.docs-empty-state h3,
.docs-error-state h3 {
  margin: 16px 0 8px;
  color: #2c3e50;
}

.docs-empty-state p,
.docs-error-state p {
  max-width: 540px;
  line-height: 1.6;
}

.docs-tree-empty {
  padding: 20px 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
}

.docs-tree-empty h3 {
  margin: 12px 0 8px;
  color: #ffffff;
}

.docs-tree-empty p {
  margin: 0;
  color: #d6dbf1;
}

@media (max-width: 1100px) {
  #docs-sidebar {
    width: 280px;
  }

  .docs-reader-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .docs-reader-pagination {
    justify-content: flex-start;
  }
}
