/* ==========================================================================
   DEVELOPER DOCUMENTATION PAGE STYLESHEET (developerSection.css)
   ========================================================================== */

:root {
  --bg-docs: #120F0F;
  --bg-sidebar: #161212;
  --bg-panel: rgba(45, 28, 27, 0.40);
  --bg-code: #0D0A0A;
  
  --primary: #FFCE1B;
  --accent-yellow: #FFCE1B;
  --accent-red: #FB1650;
  
  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-mid: rgba(255, 255, 255, 0.15);
  
  --text-white: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.65);
  --text-dimmer: rgba(255, 255, 255, 0.40);
  
  --font-head: 'DM Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --sidebar-w: 270px;
  --header-h: 60px;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-docs);
  color: var(--text-white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  width: 100%;
  height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   1. TOP BRANDING HEADER (Top-Left Logo Only)
   ========================================================================== */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: #120F0F;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

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

.docs-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.mobile-sidebar-toggle:hover {
  color: var(--text-white);
  border-color: var(--accent-yellow);
}

/* ==========================================================================
   2. TWO-REGION LAYOUT: [LEFT SIDEBAR] [MAIN CONTENT]
   ========================================================================== */
.docs-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
  position: relative;
}

/* OVERLAY FOR MOBILE SIDEBAR */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 80;
}

/* FIXED/STICKY LEFT SIDEBAR */
.docs-sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 16px;
  overflow-y: auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Search Box */
.sidebar-search-box {
  position: relative;
  width: 100%;
}

.sidebar-search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dimmer);
  pointer-events: none;
}

.sidebar-search-box input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.sidebar-search-box input:focus {
  border-color: var(--accent-yellow);
}

.sidebar-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-yellow);
  padding: 4px 0 0;
}

/* Sidebar Hierarchy Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: 4px 8px;
}

.nav-item-link {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  display: block;
}

.nav-item-link:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item-link.active {
  color: var(--accent-yellow);
  background: rgba(255, 206, 27, 0.08);
  font-weight: 500;
}

/* Expandable Rest API in sidebar */
.nav-expandable {
  display: flex;
  flex-direction: column;
}

.nav-expand-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  text-align: left;
}

.nav-expand-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.04);
}

.expand-chevron {
  transition: transform 0.2s ease;
}

.nav-expandable.open .expand-chevron {
  transform: rotate(180deg);
}

.nav-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  margin-top: 2px;
}

.nav-expandable.open .nav-children {
  display: flex;
}

.nav-item-link,
.nav-child-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dimmer);
  padding: 5px 10px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.nav-child-link:hover,
.nav-item-link:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.03);
}

.nav-child-link.active,
.nav-item-link.active {
  color: var(--accent-yellow);
  border-left-color: var(--accent-yellow);
  background: rgba(255, 206, 27, 0.08);
  font-weight: 500;
}

/* ==========================================================================
   3. MAIN CONTENT AREA (50% DOCS | 50% CODE PANEL)
   ========================================================================== */
.docs-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 32px 40px 80px;
}

.docs-section {
  display: block !important;
  padding-bottom: 72px;
  margin-bottom: 72px;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.docs-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 40px;
}

/* 50% / 50% Split Grid */
.docs-split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

/* Left 50%: Documentation Column */
.docs-prose-column {
  min-width: 0;
}

.docs-heading {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.endpoint-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  width: fit-content;
}

/* Future-proof HTTP Method Badges */
.method-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Link Badge Sizing */
.nav-item-link .method-badge,
.nav-child-link .method-badge {
  font-size: 9px !important;
  padding: 2px 5px !important;
  border-radius: 3px !important;
  letter-spacing: 0.04em !important;
  flex-shrink: 0 !important;
}

/* Badge Method Colors */
.method-badge.post {
  background: rgba(76, 175, 80, 0.2) !important;
  color: #4CAF50 !important;
  border: 1px solid rgba(76, 175, 80, 0.4) !important;
}

.method-badge.get {
  background: rgba(33, 150, 243, 0.2) !important;
  color: #2196F3 !important;
  border: 1px solid rgba(33, 150, 243, 0.4) !important;
}

.method-badge.put {
  background: rgba(255, 152, 0, 0.2) !important;
  color: #FF9800 !important;
  border: 1px solid rgba(255, 152, 0, 0.4) !important;
}

.method-badge.patch {
  background: rgba(156, 39, 176, 0.2) !important;
  color: #E040FB !important;
  border: 1px solid rgba(156, 39, 176, 0.4) !important;
}

.method-badge.delete {
  background: rgba(244, 67, 54, 0.2) !important;
  color: #F44336 !important;
  border: 1px solid rgba(244, 67, 54, 0.4) !important;
}

.method-badge.head,
.method-badge.options {
  background: rgba(158, 158, 158, 0.2) !important;
  color: #9E9E9E !important;
  border: 1px solid rgba(158, 158, 158, 0.4) !important;
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-white);
}

.copy-endpoint-btn {
  color: var(--text-dimmer);
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.copy-endpoint-btn:hover {
  color: var(--accent-yellow);
}

.subheading {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text-white);
}

.section-sub-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-white);
}

.prose-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0 0 16px;
}

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

.param-list li {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.param-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.param-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-yellow);
}

.param-type {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmer);
}

.param-required {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.param-optional {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dimmer);
  text-transform: uppercase;
}

.param-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.param-desc code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-white);
}

/* Right 50%: Code Panel with Language Selector */
.docs-code-column {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  min-width: 0;
}

.code-panel {
  background: var(--bg-code);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.code-panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.code-panel-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.code-panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dimmer);
}

.copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dimmer);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
  min-height: 28px;
}

.copy-code-btn *,
.copy-endpoint-btn * {
  pointer-events: none;
}

.copy-code-btn:hover,
.copy-code-btn:active {
  color: var(--text-white);
  border-color: var(--border-mid);
  background: rgba(255, 255, 255, 0.1);
}

.copy-code-btn.copied {
  color: #4CAF50 !important;
  background: rgba(76, 175, 80, 0.15) !important;
  border-color: rgba(76, 175, 80, 0.4) !important;
}

.lang-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dimmer);
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn.active {
  color: #000000;
  background: var(--accent-yellow);
  font-weight: 600;
}

.code-panel-body {
  padding: 16px;
  overflow-x: auto;
  max-height: 480px;
}

.code-display {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #e6e6e6;
  white-space: pre;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS (Tablet & Mobile)
   ========================================================================== */

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

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.5);
  }

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

  .sidebar-overlay.open {
    display: block;
  }

  .docs-main {
    margin-left: 0;
    padding: 24px 20px 60px;
  }

  .docs-split-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .docs-code-column {
    position: static;
  }
}

@media (max-width: 600px) {
  .docs-heading {
    font-size: 24px;
  }

  .code-panel-top-bar {
    gap: 8px;
  }

  .code-panel-title {
    font-size: 10px;
  }

  .copy-code-btn {
    font-size: 10.5px;
    padding: 4px 8px;
    min-height: 26px;
  }

  .lang-selector {
    gap: 2px;
  }

  .lang-btn {
    font-size: 10.5px;
    padding: 3px 6px;
  }
}
