.docs-layout {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto 60px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.docs-toggle {
  display: none;
  margin-bottom: 16px;
}

.docs-sidebar {
  width: 260px;
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.docs-sidebar-title {
  font-weight: 600;
  margin-bottom: 16px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-item {
  font-size: 0.95rem;
}

.toc-item.level-2 {
  margin-left: 8px;
}

.toc-item.level-3 {
  margin-left: 16px;
}

.toc-link {
  text-decoration: none;
  color: inherit;
  position: relative;
  display: inline-block;
  font-weight: 500;
  transition: color 0.4s ease;
}

.toc-link::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  background: var(--brand-gradient);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: slowScrollGradient 5s linear infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.toc-link:hover {
  color: transparent;
}

.toc-link:hover::before {
  opacity: 1;
}

.docs-content {
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.docs-content h1,
.docs-content h2,
.docs-content h3 {
  margin: 24px 0 12px;
  scroll-margin-top: 120px;
}

.docs-content p {
  line-height: 1.7;
  margin-bottom: 16px;
}

.docs-content ul {
  margin: 0 0 16px 20px;
  line-height: 1.7;
}

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

.code-block {
  position: relative;
  margin: 16px 0 24px;
}

.code-block pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-block code {
  font-family: "Courier New", monospace;
  background: transparent;
  color: inherit;
}

.code-block pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.docs-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

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

@media (max-width: 900px) {
  .docs-layout {
    flex-direction: column;
  }

  .docs-toggle {
    display: inline-flex;
    align-self: flex-start;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    max-height: none;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    z-index: 1000;
    width: min(80vw, 320px);
    padding-top: 80px;
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }
}
