/* ==========================================================================
   BeraLabs.it — Modern Dev Docs & API Portal Styling (Stripe / Mintlify Style)
   ========================================================================== */

:root {
  --docs-bg: #07090e;
  --docs-surface: #0e121a;
  --docs-surface-hover: #141a26;
  --docs-surface-subtle: #111622;
  --docs-border: rgba(255, 255, 255, 0.08);
  --docs-border-hover: rgba(255, 255, 255, 0.16);
  --docs-text: #e2e8f0;
  --docs-text-muted: #94a3b8;
  --docs-text-subtle: #64748b;
  --docs-primary: #06b6d4;
  --docs-primary-glow: rgba(6, 182, 212, 0.15);
  --docs-accent-emerald: #10b981;
  --docs-accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --docs-accent-amber: #f59e0b;
  --docs-accent-indigo: #6366f1;
  --docs-code-bg: #0b0e14;
  --docs-radius-sm: 6px;
  --docs-radius-md: 10px;
  --docs-radius-lg: 16px;
}

body.docs-page {
  background-color: var(--docs-bg);
  color: var(--docs-text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Container & Layout */
.docs-wrapper {
  display: flex;
  min-height: calc(100vh - 72px);
  max-width: 1540px;
  margin: 0 auto;
  position: relative;
  padding-top: 72px; /* Header offset */
}

/* Mobile Sidebar Toggle Button */
.docs-mobile-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 9999px;
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4);
  font-size: 0.92rem;
  font-weight: 600;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

/* Sidebar */
.docs-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  border-right: 1px solid var(--docs-border);
  padding: 28px 20px 48px 24px;
  background: var(--docs-bg);
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.docs-sidebar::-webkit-scrollbar {
  width: 5px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Sidebar Search Box */
.docs-search-container {
  position: relative;
  margin-bottom: 24px;
}
.docs-search-input {
  width: 100%;
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius-md);
  padding: 10px 38px 10px 36px;
  color: #fff;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.docs-search-input:focus {
  outline: none;
  border-color: var(--docs-primary);
  box-shadow: 0 0 0 3px var(--docs-primary-glow);
  background: #111722;
}
.docs-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--docs-text-subtle);
  pointer-events: none;
}
.docs-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--docs-text-subtle);
  cursor: pointer;
  display: none;
  padding: 4px;
}

/* Sidebar Groups */
.sidebar-group {
  margin-bottom: 28px;
}
.sidebar-group-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--docs-text-subtle);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-menu-item {
  margin: 3px 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--docs-radius-sm);
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.sidebar-link:hover {
  color: #fff;
  background: var(--docs-surface);
}
.sidebar-link.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  font-weight: 600;
}
.sidebar-link-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-get {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}
.badge-post {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.badge-wp {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

/* Main Content Area */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 36px 48px 80px 48px;
  max-width: 980px;
  box-sizing: border-box;
}

/* Header Banner inside docs */
.docs-header-hero {
  border-bottom: 1px solid var(--docs-border);
  padding-bottom: 28px;
  margin-bottom: 40px;
}
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--docs-text-subtle);
  margin-bottom: 12px;
}
.docs-breadcrumb a {
  color: var(--docs-text-muted);
  text-decoration: none;
}
.docs-breadcrumb a:hover {
  color: #fff;
}
.docs-page-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.docs-page-subtitle {
  font-size: 1.12rem;
  color: var(--docs-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Content Sections */
.docs-section {
  margin-bottom: 56px;
  scroll-margin-top: 96px;
}
.docs-section h2 {
  font-size: 1.65rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 16px 0;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--docs-border);
  padding-bottom: 12px;
}
.docs-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 28px 0 12px 0;
}
.docs-section h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #cbd5e1;
  margin: 20px 0 8px 0;
}
.docs-section p {
  color: var(--docs-text-muted);
  font-size: 0.97rem;
  margin: 0 0 16px 0;
}
.docs-section ul, .docs-section ol {
  color: var(--docs-text-muted);
  font-size: 0.95rem;
  padding-left: 24px;
  margin-bottom: 20px;
}
.docs-section li {
  margin-bottom: 8px;
}

/* Endpoint pill bar */
.endpoint-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius-md);
  padding: 10px 16px;
  margin: 16px 0 20px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}
.http-method {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.http-method.post {
  background: #10b981;
  color: #052e16;
}
.http-method.get {
  background: #0284c7;
  color: #f0f9ff;
}
.http-method.delete {
  background: #ef4444;
  color: #450a0a;
}
.endpoint-url {
  color: #f8fafc;
  font-weight: 600;
  word-break: break-all;
}

/* Callouts / Alerts */
.docs-callout {
  border-radius: var(--docs-radius-md);
  padding: 16px 20px;
  margin: 24px 0;
  border-left: 4px solid;
  background: var(--docs-surface);
  font-size: 0.92rem;
}
.docs-callout.info {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
}
.docs-callout.warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.07);
}
.docs-callout.success {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
}
.docs-callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-callout.info .docs-callout-title { color: #38bdf8; }
.docs-callout.warning .docs-callout-title { color: #fbbf24; }
.docs-callout.success .docs-callout-title { color: #34d399; }
.docs-callout p {
  margin: 0;
  color: #cbd5e1;
}

/* Tables for Parameters & Status Codes */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0 28px 0;
  border-radius: var(--docs-radius-md);
  border: 1px solid var(--docs-border);
  background: var(--docs-surface);
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
.docs-table th {
  background: rgba(255, 255, 255, 0.03);
  color: #f1f5f9;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--docs-border);
}
.docs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--docs-border);
  color: var(--docs-text-muted);
  vertical-align: top;
}
.docs-table tr:last-child td {
  border-bottom: none;
}
.docs-table code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
}

/* Code Snippet Box & Multi-tab */
.code-box {
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius-md);
  margin: 20px 0 28px 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f131c;
  padding: 8px 16px;
  border-bottom: 1px solid var(--docs-border);
}
.code-tabs {
  display: flex;
  gap: 4px;
}
.code-tab-btn {
  background: transparent;
  border: none;
  color: var(--docs-text-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.code-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.code-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}
.code-copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--docs-border);
  color: var(--docs-text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.code-copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.code-content-panel {
  display: none;
  padding: 16px 20px;
  margin: 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #e2e8f0;
}
.code-content-panel.active {
  display: block;
}
.code-content-panel pre {
  margin: 0;
  padding: 0;
  white-space: pre;
}

/* Feature Grid Cards */
.docs-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0 32px 0;
}
.docs-card {
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius-md);
  padding: 20px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: block;
}
.docs-card:hover {
  border-color: var(--docs-border-hover);
  background: var(--docs-surface-hover);
  transform: translateY(-2px);
}
.docs-card-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.docs-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.docs-card-desc {
  font-size: 0.86rem;
  color: var(--docs-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* TOC Table of Contents (Right Sticky or Inline) */
.docs-toc {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  padding: 36px 0 48px 24px;
  box-sizing: border-box;
  display: block;
}
.docs-toc-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--docs-text-subtle);
  margin-bottom: 12px;
}
.docs-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--docs-border);
}
.docs-toc li {
  margin: 0;
}
.docs-toc a {
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.docs-toc a:hover {
  color: #fff;
}
.docs-toc a.active {
  color: #38bdf8;
  border-left-color: #38bdf8;
  font-weight: 600;
}

/* Responsive Breakpoints */
@media (max-width: 1280px) {
  .docs-toc {
    display: none;
  }
}

@media (max-width: 991px) {
  .docs-mobile-sidebar-toggle {
    display: inline-flex;
  }
  .docs-sidebar {
    position: fixed;
    top: 72px;
    left: -340px;
    width: 300px;
    height: calc(100vh - 72px);
    z-index: 98;
    background: #090c12;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.7);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .docs-sidebar.open {
    left: 0;
  }
  .docs-main {
    padding: 24px 20px 60px 20px;
  }
  .docs-page-title {
    font-size: 1.9rem;
  }
}
