/* ============================================================
   DIMA AI Documentation System Styles
   Inspired by Mastra documentation design (dark theme, green accent)
   ============================================================ */

/* Prevent main.css overflow-x: hidden from killing sticky positioning */
html.docs-page-html {
  overflow: visible !important;
  overflow-x: visible !important;
  max-width: none !important;
  height: auto !important;
}

body.docs-page {
  background: #0a0a0a;
  max-width: none;
  overflow: visible !important;
  overflow-x: hidden !important; /* Prevent horizontal scroll from sticky offsets if any */
  padding-top: 0; /* Changed to 0 because wrapper is sticky */
  margin: 0;
  position: relative;
}

body.docs-home {
  background: var(--docs-bg);
  max-width: none;
  overflow: visible !important;
}

/* ============================================================
   DOCUMENTATION HOME PAGE
   ============================================================ */

.docs-home-hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid var(--docs-border);
}

.docs-hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  aspect-ratio: 1;
  background: var(--gradient-atmosphere);
  filter: blur(120px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
  animation: glow-rotate 120s linear infinite;
}

@keyframes glow-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.docs-home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  width: 100%;
}

.docs-home-hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.docs-home-hero-subtitle {
  font-size: 1.25rem;
  color: var(--docs-text-muted);
  margin-bottom: 48px;
  line-height: 1.5;
}

.docs-home-search {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.docs-home-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--docs-text-dim);
  pointer-events: none;
  z-index: 2;
  opacity: 0.8;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.5));
}

.docs-home-search-input {
  width: 100%;
  padding: 20px 24px 20px 56px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-font-smoothing: antialiased;
}

.docs-home-search-input:focus {
  outline: none;
  border-color: var(--docs-accent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(96, 217, 74, 0.1), 0 20px 40px rgba(0,0,0,0.4);
}

.docs-home-content {
  max-width: 1000px; /* Reduced for better margins */
  margin: 0 auto;
  padding: 80px 24px;
}

.docs-home-section {
  margin-bottom: 100px;
}

.docs-home-section-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 48px;
  text-align: center;
  letter-spacing: -0.01em;
}

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

.docs-category-card {
  padding: 24px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.docs-category-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--docs-accent);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.docs-category-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: block;
}

.docs-category-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.docs-category-desc {
  font-size: 13px;
  color: var(--docs-text-dim);
  margin-bottom: 16px;
  line-height: 1.5;
}

.docs-category-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--docs-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 16px;
  background: rgba(96, 217, 74, 0.08);
  border: 1px solid rgba(96, 217, 74, 0.2);
  border-radius: 100px;
}

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

.docs-popular-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.docs-popular-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--docs-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.docs-popular-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.docs-popular-excerpt {
  font-size: 14px;
  color: var(--docs-text-dim);
  margin-bottom: 18px;
  line-height: 1.6;
}

.docs-popular-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
}

/* Ensure ALL parent containers have visible overflow for sticky to function */
.docs-layout {
  display: grid;
  grid-template-columns: var(--docs-sidebar-width) 1fr var(--docs-toc-width);
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: calc(100vh - var(--docs-header-height));
  background: var(--docs-bg);
  overflow: visible !important;
}

.docs-layout > *,
.docs-header-inner,
.docs-footer-inner {
  max-width: none;
}

/* Top alignment fix - zero padding on columns, only internal content gets it */
.docs-main,
.docs-toc {
  padding-top: 0 !important;
  overflow: visible !important;
}

.docs-sidebar-inner,
.docs-main,
.docs-toc {
  padding-top: 24px !important; /* Unified top alignment */
}

:root {
  --docs-bg: #0a0a0a;
  --docs-bg-elevated: #111111;
  --docs-bg-hover: rgba(255, 255, 255, 0.05);
  --docs-border: rgba(255, 255, 255, 0.06);
  --docs-text: #ffffff;
  --docs-text-muted: rgba(255, 255, 255, 0.7);
  --docs-text-dim: rgba(255, 255, 255, 0.5);
  --docs-primary: #8ab4f8;
  --docs-primary-hover: #a8c7fa;
  --docs-accent: #eec886;
  --docs-accent-hover: #e2ba74;
  --docs-success: #4ade80;
  --docs-warning: #fbbf24;
  --docs-danger: #f87171;
  --docs-header-height: 64px;
  /* Balanced widths for a more spacious feel */
  --docs-sidebar-width: 280px;
  --docs-toc-width: 280px;
  --docs-content-max: 960px;
}

/* ============================================================
   TOP WRAPPER (Sticky)
   ============================================================ */

.docs-top-wrapper {
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
}

/* ============================================================
   TOP NOTIFICATION BANNER
   ============================================================ */

.docs-notification {
  background: #0a0a0a; /* Fully opaque black background */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 24px;
  font-size: 13px;
  text-align: center;
  color: #fff;
  position: relative;
  z-index: 501;
}

.docs-notification--info {
  background: rgb(27, 33, 43)
}

.docs-notification--warning {
  background: rgba(251, 191, 36, 0.12);
}

.docs-notification--success {
  background: rgba(74, 222, 128, 0.12);
}

.docs-notification--announcement {
  background: rgba(96, 217, 74, 0.15);
  border-bottom-color: rgba(96, 217, 74, 0.3);
}

.docs-notification-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.docs-notification-message {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.docs-notification-link {
  color: var(--docs-accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s;
}

.docs-notification-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

/* ============================================================
   DOCUMENTATION HEADER (inside wrapper)
   ============================================================ */

.docs-header {
  position: relative; /* No longer absolute fixed itself */
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  z-index: 500;
  height: var(--docs-header-height);
  background: #0a0a0a; /* Solid background, matching page bg */
  border-bottom: 1px solid var(--docs-border);
}

.docs-header-inner {
  max-width: 100%;
  margin: 0;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.docs-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.docs-logo-img {
  height: 28px;
  width: auto;
}

.docs-header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.docs-header-link {
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.docs-header-link:hover {
  color: var(--docs-text);
}

.docs-header-link.active {
  color: var(--docs-accent);
  position: relative;
}

.docs-header-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--docs-accent);
  border-radius: 1px;
}

.docs-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 502; /* Ensure above mobile menu */
}

.docs-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--docs-border);
  border-radius: 6px;
  color: var(--docs-text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.docs-search-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.docs-search-hint {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
}

.docs-cta-btn {
  padding: 8px 16px;
  background: var(--docs-accent);
  color: #000 !important; /* Force black text on buttons */
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.docs-cta-btn:hover {
  background: var(--docs-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(96, 217, 74, 0.35);
}

.docs-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.docs-mobile-toggle span {
  width: 20px;
  height: 2px;
  background: var(--docs-text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ============================================================
   MAIN DOCUMENTATION LAYOUT
   ============================================================ */

.docs-layout {
  display: grid;
  grid-template-columns: var(--docs-sidebar-width) 1fr var(--docs-toc-width);
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: calc(100vh - var(--docs-header-height));
  background: var(--docs-bg);
}

.docs-layout > .docs-sidebar,
.docs-layout > .docs-main,
.docs-layout > .docs-toc {
  min-width: 0;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */

.docs-sidebar {
  position: sticky;
  top: var(--docs-header-height);
  align-self: start;
  background: var(--docs-bg);
  border-right: 1px solid var(--docs-border);
  /* Scroll inside sidebar (WP/Docs style) */
  height: calc(100vh - var(--docs-header-height));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.has-notification .docs-sidebar {
  top: calc(var(--docs-header-height) + 35px); /* Offset for notification height */
  height: calc(100vh - var(--docs-header-height) - 35px);
}

.docs-sidebar-inner {
  padding: 18px 12px 40px 18px;
}

/* Each collapsible section */
.docs-sidebar-section {
  margin-bottom: 4px;
  border: none;
}

/* Hide native marker */
.docs-sidebar-section summary { list-style: none; }
.docs-sidebar-section summary::-webkit-details-marker { display: none; }

/* Category row (the clickable <summary>) */
.docs-sidebar-category {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 650;
  color: var(--docs-text);
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.docs-sidebar-category:hover {
  background: var(--docs-bg-hover);
}

.docs-sidebar-section[open] > .docs-sidebar-category {
  background: rgba(255, 255, 255, 0.03);
}

/* Chevron */
.docs-sidebar-chevron {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.15s;
}
.docs-sidebar-category:hover .docs-sidebar-chevron { opacity: 0.7; }
.docs-sidebar-section[open] > .docs-sidebar-category .docs-sidebar-chevron {
  transform: rotate(180deg);
}

/* Emoji icon */
.docs-sidebar-category-icon {
  font-size: 15px;
  line-height: 1;
}

.docs-sidebar-category-name {
  flex: 1;
}

/* Subcategory group - tighter spacing */
.docs-sidebar-subcategory {
  margin: 8px 0 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-sidebar-subcategory-title {
  padding: 6px 10px 6px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--docs-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Link list */
.docs-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2px;
}

.docs-sidebar-list li {
  margin: 0;
}

/* Nav links – 14px, readable, hover bg */
.docs-sidebar-link {
  display: block;
  padding: 7px 10px 7px 10px;
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

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

.docs-sidebar-link.active {
  color: var(--docs-accent);
  background: rgba(255, 220, 81, 0.1);
  font-weight: 650;
}

.docs-sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--docs-accent);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.docs-main {
  width: 100%;
  max-width: 100%;
  padding: 16px 48px 48px;
  margin: 0;
  border-left: 1px solid var(--docs-border);
  border-right: 1px solid var(--docs-border);
  /* Force left alignment of all content */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.docs-article {
  /* Allow article to fill the main content column fully */
  max-width: 100% !important;
  margin: 0 !important;
}

/* Breadcrumbs */
.docs-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--docs-text-dim);
}

.docs-breadcrumbs a {
  color: var(--docs-text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.docs-breadcrumbs a:hover {
  color: var(--docs-accent);
}

.docs-breadcrumb-separator {
  color: var(--docs-text-dim);
  opacity: 0.6;
  user-select: none;
}

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

/* Article Header */
.docs-article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--docs-border);
  max-width: 100% !important;
}

.docs-article-title {
  font-size: clamp(2rem, 4vw + 1rem, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--docs-text);
  margin-bottom: 12px;
}

.docs-article-excerpt {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--docs-text-muted);
  margin-bottom: 20px;
  /* Removed restrictive max-width to allow full container usage */
  max-width: 100%;
}

.docs-article-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--docs-text-dim);
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--docs-border);
}

.docs-article-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-article-meta-item svg {
  opacity: 0.7;
  flex-shrink: 0;
}

/* Article Content */
.docs-article-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--docs-text-muted);
  max-width: 100% !important;
}

/* Force override of main.css p { max-width: 65ch } which was causing the "cutout" look */
.docs-article-content p,
.docs-article-content ul,
.docs-article-content ol,
.docs-article-content blockquote,
.docs-article-excerpt,
.docs-article-content h1,
.docs-article-content h2,
.docs-article-content h3,
.docs-article-content h4,
.docs-article-content h5,
.docs-article-content h6 {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.docs-article-content pre {
  max-width: 100% !important;
}

.docs-article-content h2 {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--docs-text);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.25rem;
  scroll-margin-top: calc(var(--docs-header-height) + 1rem);
  border-top: 1px solid var(--docs-border);
}

.docs-article-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-article-content h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--docs-text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: calc(var(--docs-header-height) + 1rem);
}

.docs-article-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--docs-text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-article-content p {
  margin-bottom: 1.25rem;
}

.docs-article-content a {
  color: var(--docs-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.docs-article-content a:hover {
  border-bottom-color: var(--docs-primary);
}

.docs-article-content ul,
.docs-article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.docs-article-content li {
  margin-bottom: 0.5rem;
}

.docs-article-content li::marker {
  color: var(--docs-text-dim);
}

.docs-article-content code {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--docs-border);
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  color: var(--docs-primary);
}

.docs-article-content pre {
  margin: 24px 0;
  padding: 20px;
  background: var(--docs-bg-elevated);
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  overflow-x: auto;
}

.docs-article-content pre code {
  padding: 0;
  background: none;
  border: none;
  color: var(--docs-text-muted);
  font-size: 14px;
}

.docs-article-content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--docs-primary);
  background: rgba(138, 180, 248, 0.05);
  border-radius: 0 8px 8px 0;
  color: var(--docs-text-muted);
}

.docs-article-content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  overflow: hidden;
}

.docs-article-content th,
.docs-article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--docs-border);
}

.docs-article-content th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--docs-text);
}

.docs-article-content tr:last-child td {
  border-bottom: none;
}

.docs-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
}

/* Blog-components inside doc content */
.docs-article-content .info-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--docs-primary);
  color: var(--docs-text-muted);
}

.docs-article-content .info-box.success { border-color: var(--docs-success); }
.docs-article-content .info-box.warning { border-color: var(--docs-warning); }
.docs-article-content .info-box.error { border-color: var(--docs-danger); }

.docs-article-content .quote-card {
  background: rgba(255, 255, 255, 0.02);
  border-left-color: var(--docs-accent);
}

.docs-article-content .note-card {
  background: rgba(96, 217, 74, 0.1);
  border: 1px solid rgba(96, 217, 74, 0.2);
}

.docs-article-content .feature-item,
.docs-article-content .stat-card {
  background: var(--docs-bg-elevated);
  border-color: var(--docs-border);
}

.docs-article-content .feature-item:hover,
.docs-article-content .stat-card:hover {
  border-color: rgba(96, 217, 74, 0.3);
}

.docs-article-content .stat-value {
  color: var(--docs-accent);
}

.docs-article-content .comparison-table {
  border-color: var(--docs-border);
}

.docs-article-content .comparison-table th,
.docs-article-content .comparison-table td {
  border-bottom-color: var(--docs-border);
}

/* Article Footer */
.docs-article-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--docs-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.docs-article-helpful {
  display: flex;
  align-items: center;
  gap: 16px;
}

.docs-article-helpful-text {
  font-size: 14px;
  color: var(--docs-text-muted);
}

.docs-article-helpful-buttons {
  display: flex;
  gap: 8px;
}

.docs-helpful-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--docs-border);
  border-radius: 6px;
  color: #fff; /* Improved readability */
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.docs-helpful-btn.clicked.docs-helpful-btn--yes,
.docs-helpful-btn.clicked.docs-helpful-btn--no {
  color: #000 !important;
}

.docs-helpful-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--docs-text);
}

.docs-helpful-btn.clicked {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--docs-success);
}

.docs-feedback-thanks {
  color: var(--docs-success);
  font-size: 14px;
  font-weight: 500;
}

.docs-edit-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.docs-edit-link:hover {
  color: var(--docs-primary);
}

/* ============================================================
   RIGHT SIDEBAR - TABLE OF CONTENTS
   ============================================================ */

.docs-toc {
  position: sticky;
  top: var(--docs-header-height);
  align-self: start;
  background: var(--docs-bg);
  /* Remove fixed height and internal scrolling for proper page-level stickiness */
  height: auto;
  overflow: visible;
  padding: 16px 24px 40px 12px;
}

.has-notification .docs-toc {
  top: calc(var(--docs-header-height) + 35px); /* Offset for notification height */
}

.docs-toc-inner {
  position: relative;
}

.docs-toc-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--docs-text-dim);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

/* .docs-toc-nav is a structural wrapper; no styles needed */

.docs-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-toc-list li {
  margin-bottom: 2px;
}

.docs-toc-link {
  display: block;
  padding: 5px 8px 5px 12px;
  color: var(--docs-text-dim);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.docs-toc-link:hover {
  color: var(--docs-text-muted);
}

.docs-toc-link.active {
  color: var(--docs-accent);
  border-left-color: var(--docs-accent);
  font-weight: 500;
}

.docs-toc-empty {
  font-size: 13px;
  color: var(--docs-text-dim);
  font-style: italic;
}

/* ============================================================
   DOCUMENTATION FOOTER
   ============================================================ */

.docs-footer {
  border-top: 1px solid var(--docs-border);
  background: var(--docs-bg);
  padding: 48px 24px 24px;
}

.docs-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}

.docs-footer-logo {
  height: 28px;
  width: auto;
  margin-bottom: 16px;
}

.docs-footer-tagline {
  font-size: 14px;
  color: var(--docs-text-muted);
  line-height: 1.6;
}

.docs-footer-nav {
  display: contents;
}

.docs-footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--docs-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.docs-footer-col a {
  display: block;
  padding: 6px 0;
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

.docs-footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--docs-border);
  text-align: center;
  font-size: 13px;
  color: var(--docs-text-dim);
}

/* ============================================================
   DOCS LANDING PAGE (/docs)
   ============================================================ */

.docs-home {
  min-height: 100vh;
  background: var(--docs-bg);
}

.docs-home-sidebar-wrapper {
  display: none;
}

@media (max-width: 1024px) {
  .docs-home-sidebar-wrapper {
    display: block;
  }
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1400px) {
  .docs-layout {
    grid-template-columns: var(--docs-sidebar-width) 1fr;
  }
  
  .docs-toc {
    display: none;
  }
}

@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    width: 100%; /* Full width on mobile */
    height: calc(100vh - var(--docs-header-height)); /* Full height minus header */
    bottom: 0;
    background: #0a0a0a; /* Ensure solid background */
    transform: translateY(-10px); /* Small offset for animation */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 499; /* Below header but above content */
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .has-notification .docs-sidebar {
    top: calc(var(--docs-header-height) + 35px);
    height: calc(100vh - var(--docs-header-height) - 35px);
  }
  
  .docs-sidebar.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .docs-sidebar-inner {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
  }

  .docs-mobile-toggle {
    display: flex;
  }
  
  .docs-main {
    padding: 24px 24px 40px;
  }
  
  .docs-header-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .docs-home-hero {
    padding: 48px 20px 40px;
  }

  .docs-home-hero-title {
    font-size: clamp(2rem, 10vw, 40px);
  }

  .docs-home-hero-subtitle {
    font-size: 1.125rem;
  }

  .docs-home-content {
    padding: 40px 20px;
  }

  .docs-home-section {
    margin-bottom: 48px;
  }

  .docs-categories-grid,
  .docs-popular-grid {
    grid-template-columns: 1fr;
  }

  .docs-article-title {
    font-size: 32px;
  }
  
  .docs-article-excerpt {
    font-size: 16px;
  }
  
  .docs-article-content {
    font-size: 15px;
  }
  
  .docs-article-content h2 {
    font-size: 24px;
  }
  
  .docs-article-content h3 {
    font-size: 20px;
  }
  
  .docs-article-footer {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }
  
  .docs-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  
  .docs-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .docs-header-inner {
    padding: 0 16px;
  }
  
  .docs-main {
    padding: 1rem 1rem 1.5rem;
  }
  
  .docs-search-hint {
    display: none;
  }
  
  .docs-cta-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .docs-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */

.docs-sidebar::-webkit-scrollbar,
.docs-toc::-webkit-scrollbar {
  width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track,
.docs-toc::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb,
.docs-toc::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover,
.docs-toc::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Sidebar CTA */
.docs-sidebar-cta {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-cta-link {
  display: block;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
}

.docs-cta-link:hover {
  transform: translateY(-4px);
  border-color: #8ab4f8;
  background: rgba(138, 180, 248, 0.05);
}

.docs-cta-image {
  width: 100%;
  aspect-ratio: 1.6 / 1;
  overflow: hidden;
  background: #111;
}

.docs-cta-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.docs-cta-link:hover .docs-cta-image img {
  transform: scale(1.05);
}

.docs-cta-content {
  padding: 16px;
}

.docs-cta-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
}

.docs-cta-btn {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #8ab4f8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Next Article Button */
.docs-next-article {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Align to the right */
  text-align: right;
}

.docs-next-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
}

.docs-next-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #22c55e;
  color: #000 !important;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.docs-next-link:hover {
  transform: translateX(4px) translateY(-2px);
  background: #2edb6d;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

/* Likes count in helpful button */
.docs-likes-count {
  margin-left: 6px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #86efac;
}

.docs-helpful-btn.clicked.docs-helpful-btn--yes {
  background: #22c55e !important;
  border-color: #22c55e;
  color: #000 !important;
}

.docs-helpful-btn.clicked.docs-helpful-btn--no {
  background: #ef4444 !important;
  border-color: #ef4444;
  color: #000 !important;
}
