/* =========================================
   Top Navbar
   ========================================= */
.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 40px;
  background: var(--sui-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.docs-topbar-brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--sui-text);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.docs-topbar-brand span { color: var(--sui-primary); }
.docs-topbar-nav {
  display: flex;
  gap: 4px;
  margin-left: 24px;
}
.docs-topbar-nav a {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sui-text-muted);
  border-radius: var(--sui-radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
}
.docs-topbar-nav a:hover { color: var(--sui-text); background: var(--sui-bg-dark); }
.docs-topbar-nav a.active { color: var(--sui-primary); background: rgba(91,84,224,0.1); font-weight: 600; }
.docs-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.docs-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sui-bg);
  box-shadow: var(--sui-shadow-raised-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.25s ease;
  color: var(--sui-text-muted);
}
.docs-theme-toggle:hover { box-shadow: var(--sui-shadow-inset-sm); }
.docs-topbar-icon {
  display: flex;
  align-items: center;
  color: var(--sui-text-muted);
  transition: color 0.2s ease;
}
.docs-topbar-icon:hover { color: var(--sui-text); }

/* =========================================
   Hero
   ========================================= */
.docs-hero {
  text-align: center;
  padding: 72px 40px 56px;
}
.docs-hero h1 {
  font-size: 56px;
  font-weight: 800;
  color: var(--sui-text);
  margin-bottom: 16px;
  letter-spacing: -2px;
}
.docs-hero h1 span { color: var(--sui-primary); }
.docs-hero p {
  color: var(--sui-text-muted);
  font-size: 18px;
  max-width: 520px;
  margin: 0 auto 0;
  line-height: 1.7;
}

/* =========================================
   Bento Grid
   ========================================= */
.docs-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px 80px;
}
.bento-card {
  background: var(--sui-bg);
  border-radius: var(--sui-radius-lg);
  box-shadow: var(--sui-shadow-raised);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.bento-card:hover {
  box-shadow: var(--sui-shadow-raised-lg);
  transform: translateY(-4px);
  color: var(--sui-text);
}
.bento-card:hover .bento-explore {
  opacity: 1;
  transform: translateX(0);
}
.bento-lg { grid-column: span 2; }
.bento-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sui-text-light);
  margin-bottom: 8px;
}
.bento-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--sui-text);
  margin-top: auto;
}
.bento-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 0;
  pointer-events: none;
}
.bento-explore {
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sui-primary);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.25s ease;
}

/* =========================================
   Component Page Layout
   ========================================= */
.docs-component {
  display: flex;
  min-height: calc(100vh - 60px);
}

.docs-pg-sidebar {
  width: 220px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 24px 16px;
  flex-shrink: 0;
  border-right: 1px solid var(--sui-bg-dark);
}
.pg-sidebar-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sui-text-light);
  padding: 16px 12px 6px;
}
.pg-sidebar-cat:first-child { padding-top: 0; }
.pg-sidebar-link {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sui-text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 1px;
  cursor: pointer;
}
.pg-sidebar-link:hover { color: var(--sui-text); background: rgba(91,84,224,0.05); }
.pg-sidebar-link.active { color: var(--sui-primary); background: rgba(91,84,224,0.1); font-weight: 600; }

.docs-pg-main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
}
.docs-pg-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.docs-pg-desc {
  color: var(--sui-text-muted);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Preview Area */
.pg-preview-box {
  background: var(--sui-bg);
  border-radius: var(--sui-radius-lg);
  box-shadow: var(--sui-shadow-inset);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 140px;
  margin-bottom: 20px;
}
.pg-code-box {
  background: var(--sui-bg-dark);
  border-radius: var(--sui-radius-sm);
  padding: 20px 24px;
  position: relative;
  margin-bottom: 40px;
}
.pg-code-box pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--sui-text);
  white-space: pre;
  overflow-x: auto;
}
.pg-code-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--sui-font);
  color: var(--sui-text-muted);
  background: var(--sui-bg);
  border: 1px solid var(--sui-bg-dark);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pg-code-copy:hover { color: var(--sui-primary); border-color: var(--sui-primary); }

/* Gallery Subsections */
.pg-section {
  margin-bottom: 48px;
}
.pg-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--sui-text);
  margin-bottom: 16px;
}
.pg-section-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.pg-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 12px;
}
.pg-code-wrap { margin-top: 12px; margin-bottom: 0; }
.pg-code-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sui-font);
  color: var(--sui-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.pg-code-toggle:hover { color: var(--sui-primary); }
.pg-code-toggle .chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 10px;
}
.pg-code-toggle.open .chevron { transform: rotate(90deg); }
.pg-code-block {
  display: none;
  margin-top: 8px;
  background: var(--sui-bg-dark);
  border-radius: 12px;
  padding: 16px 20px;
  position: relative;
  overflow-x: auto;
}
.pg-code-block.open { display: block; }
.pg-code-block pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--sui-text);
  white-space: pre;
}

/* =========================================
   Control Panel (Right Sidebar)
   ========================================= */
.docs-pg-controls {
  width: 260px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 24px 20px;
  flex-shrink: 0;
  border-left: 1px solid var(--sui-bg-dark);
}
.pg-controls-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sui-text-light);
  margin-bottom: 20px;
}
.pg-control-group {
  margin-bottom: 20px;
}
.pg-control-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--sui-text);
  margin-bottom: 8px;
}
.pg-control-group .sui-radio,
.pg-control-group .sui-checkbox {
  display: flex;
  margin-bottom: 6px;
  font-size: 13px;
}
.pg-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pg-control-row .pg-control-label { margin-bottom: 0; }
.pg-divider {
  height: 1px;
  background: var(--sui-bg-dark);
  margin: 20px 0;
}
/* On-this-page for gallery views */
.pg-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sui-text-light);
  margin-bottom: 12px;
}
.pg-toc-link {
  display: block;
  font-size: 13px;
  color: var(--sui-text-muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.pg-toc-link:hover { color: var(--sui-primary); }

/* =========================================
   Misc
   ========================================= */
.docs-table-wrap {
  overflow-x: auto;
  border-radius: var(--sui-radius);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* =========================================
   Hamburger Button
   ========================================= */
.docs-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 8px 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.docs-hamburger:hover { background: var(--sui-bg-dark); }
.docs-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--sui-text);
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* =========================================
   Mobile Drawer
   ========================================= */
.docs-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 299;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.docs-mobile-overlay.open {
  display: block;
  opacity: 1;
}
.docs-mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--sui-bg);
  z-index: 300;
  overflow-y: auto;
  padding: 0 0 32px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}
.docs-mobile-drawer.open {
  transform: translateX(0);
}
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sui-bg-dark);
}
.docs-mobile-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: none;
  border: none;
  color: var(--sui-text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.docs-mobile-close:hover { background: var(--sui-bg-dark); color: var(--sui-text); }
.mobile-drawer-links {
  padding: 12px 16px 4px;
}
.mobile-drawer-links a {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sui-text);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.mobile-drawer-links a:hover { background: rgba(91,84,224,0.08); color: var(--sui-primary); }
.mobile-drawer-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sui-text-light);
  padding: 20px 28px 6px;
}
.mobile-drawer-link {
  display: block;
  padding: 8px 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sui-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.mobile-drawer-link:hover { color: var(--sui-primary); }
.mobile-drawer-link.active { color: var(--sui-primary); font-weight: 600; background: rgba(91,84,224,0.1); border-radius: 8px; margin-left: 16px; margin-right: 16px; padding-left: 12px; padding-right: 12px; }
body.mobile-nav-open { overflow: hidden; }

/* =========================================
   Responsive Breakpoints
   ========================================= */
@media (max-width: 1100px) {
  .docs-pg-controls { display: none; }
}
@media (max-width: 900px) {
  .docs-pg-sidebar { display: none; }
  .docs-bento { grid-template-columns: repeat(2, 1fr); }
  .docs-pg-main { padding: 24px 20px; }
  .docs-hamburger { display: flex; }
  .docs-topbar-nav { display: none; }
  .pg-preview-box { padding: 32px 24px; }
}
@media (max-width: 600px) {
  .docs-bento { grid-template-columns: 1fr; padding: 0 16px 48px; }
  .bento-lg { grid-column: span 1; }
  .docs-topbar { padding: 12px 16px; gap: 12px; }
  .docs-hero { padding: 48px 20px 36px; }
  .docs-hero h1 { font-size: 36px; letter-spacing: -1px; }
  .docs-hero p { font-size: 15px; }
  .docs-pg-main { padding: 20px 16px; }
  .docs-pg-title { font-size: 26px; }
  .docs-pg-desc { font-size: 14px; margin-bottom: 24px; }
  .pg-preview-box { padding: 24px 16px; }
  .pg-code-box { padding: 16px; }
  .pg-section { margin-bottom: 36px; }
  .pg-section-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .bento-card { min-height: 160px; }
  .docs-footer-inner { flex-direction: column; text-align: center; }
}

/* =========================================
   Footer
   ========================================= */
.docs-footer {
  margin-top: 0;
  padding: 32px 24px;
  border-top: 1px solid var(--sui-bg-dark);
}

.docs-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.docs-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-footer-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--sui-text);
  letter-spacing: -0.5px;
}

.docs-footer-logo span {
  color: var(--sui-primary);
}

.docs-footer-tagline {
  font-size: 13px;
  color: var(--sui-text-muted);
}

.docs-footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.docs-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sui-text-muted);
  background: var(--sui-bg);
  border-radius: var(--sui-radius-xs);
  box-shadow: var(--sui-shadow-raised-sm);
  text-decoration: none;
  transition: color var(--sui-transition-fast), box-shadow var(--sui-transition-fast);
}

.docs-footer-link:hover {
  color: var(--sui-text);
  box-shadow: var(--sui-shadow-raised);
}

/* =========================================
   Getting Started Page
   ========================================= */
.docs-getstarted-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.docs-getstarted-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.docs-getstarted-desc {
  font-size: 16px;
  color: var(--sui-text-muted);
  margin-bottom: 40px;
}

.docs-getstarted-section {
  margin-bottom: 36px;
}

.docs-getstarted-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.docs-getstarted-section p {
  font-size: 14px;
  color: var(--sui-text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.docs-getstarted-code {
  background: var(--sui-bg-dark);
  border-radius: var(--sui-radius-sm);
  padding: 20px 24px;
  overflow-x: auto;
}

.docs-getstarted-code pre {
  margin: 0;
  padding: 0;
}

.docs-getstarted-code code {
  padding: 0;
  background: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .docs-getstarted-page { padding: 32px 16px 48px; }
  .docs-getstarted-title { font-size: 26px; }
  .docs-getstarted-code { padding: 16px; }
}
