/* AILA API Docs — code-samples.css v7.0
   Responsive, all-device support, 5-language tabs, enhanced UX */

html { scroll-behavior: smooth }

/* ══════════════════════════════════════════════
   READING PROGRESS BAR
   ══════════════════════════════════════════════ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0066FF, #00C48C);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ══════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════ */
.samples-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #0F172A 100%);
  padding: 4rem 0 3.5rem;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.samples-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,102,255,0.18) 0%, transparent 65%);
  pointer-events: none;
}
.samples-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 10%;
  width: 260px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,196,140,0.14) 0%, transparent 65%);
  pointer-events: none;
}
.samples-hero .container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}
.samples-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,102,255,0.15);
  border: 1px solid rgba(0,102,255,0.3);
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  color: #60A5FA;
  margin-bottom: 1.25rem;
}
.samples-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
.samples-hero p {
  font-size: 1rem;
  color: #94A3B8;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 1.25rem;
}

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #CBD5E1;
}
.hero-stat i { font-size: 0.72rem; color: #60A5FA }
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #60A5FA;
  margin-bottom: 1.5rem;
}
.hero-meta i { margin-right: 0.3rem }
.hero-meta code {
  background: rgba(255,255,255,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #86EFAC;
  word-break: break-all;
}

/* Hero CTAs */
.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}
.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0066FF;
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(0,102,255,0.35);
}
.hero-btn-primary:hover {
  background: #0052CC;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,102,255,0.45);
  color: white;
  text-decoration: none;
}
.hero-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.35);
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  min-height: 48px;
}
.hero-btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.65);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════
   DOCS LAYOUT — SIDEBAR + MAIN
   ══════════════════════════════════════════════ */
.docs-nav-toggle {
  display: none;
  width: 100%;
  background: white;
  border: none;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0F172A;
  text-align: left;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  min-height: 48px;
}
.docs-nav-toggle i { font-size: 0.82rem; transition: transform 0.2s }
.docs-nav-toggle.open i.fa-chevron-down { transform: rotate(180deg) }

.docs-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 80vh;
  background: #F8FAFC;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: white;
  border-right: 1px solid #E2E8F0;
  padding: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #E2E8F0 transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px }
.docs-sidebar::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px }
.sidebar-nav { flex: 1 }
.sidebar-search {
  padding: 0.75rem 1rem 0.5rem;
  position: relative;
}
.sidebar-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #334155;
  background: #F8FAFC;
  transition: all 0.2s;
  min-height: 36px;
}
.sidebar-search-input:focus {
  outline: none;
  border-color: #0066FF;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,102,255,0.08);
}
.sidebar-search-input::placeholder { color: #94A3B8 }
.sidebar-search-icon {
  position: absolute;
  left: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 0.7rem;
  pointer-events: none;
}
.sidebar-link.search-hidden { display: none }
.sidebar-section.search-hidden { display: none }
.sidebar-search-empty {
  padding: 0.75rem 1.5rem;
  font-size: 0.78rem;
  color: #94A3B8;
  text-align: center;
  display: none;
}
.sidebar-search-empty.visible { display: block }
.sidebar-section { margin-bottom: 1.5rem; padding: 0 1rem }
.sidebar-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 0.1rem;
  min-height: 40px;
}
.sidebar-link i {
  font-size: 0.78rem;
  width: 14px;
  text-align: center;
  color: #94A3B8;
  flex-shrink: 0;
}
.sidebar-link:hover { background: #F1F5F9; color: #0052CC; text-decoration: none }
.sidebar-link.active {
  background: #EFF6FF;
  color: #0052CC;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #0066FF;
  transform: translateX(2px);
  transition: all 0.2s ease;
}
.sidebar-link.active i { color: #0052CC }
.sidebar-link-accent { color: #0052CC !important; font-weight: 600 }
.sidebar-link-accent i { color: #0052CC !important }
.sidebar-link-accent:hover { background: #EFF6FF !important }
.sidebar-cta { padding: 1rem 1.5rem 0 }
.sidebar-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  min-height: 44px;
  box-shadow: 0 2px 8px rgba(0,102,255,0.25);
}
.sidebar-cta-btn:hover {
  background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,102,255,0.35);
}

/* Main content area */
.docs-main {
  padding: 2.5rem 3rem 4rem;
  max-width: 900px;
  width: 100%;
  min-width: 0;
}
.docs-main section {
  padding-top: 1rem;
  margin-bottom: 3.5rem;
  scroll-margin-top: 80px;
  animation: sectionFade 0.32s ease both;
}

@keyframes sectionFade {
  from { opacity: 0; transform: translateY(12px) }
  to { opacity: 1; transform: translateY(0) }
}

/* ══════════════════════════════════════════════
   SECTION TITLES & CONTENT
   ══════════════════════════════════════════════ */
.section-icon { color: #0052CC; margin-right: 0.5rem; font-size: 1rem }
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 0.4rem;
  padding-bottom: 0.6rem;
  padding-left: 1rem;
  border-left: 4px solid #0066FF;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-title .try-live-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: #0052CC;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 32px;
  flex-shrink: 0;
}
.section-title .try-live-link:hover { background: #DBEAFE; color: #1D4ED8; text-decoration: none }
.section-subtitle {
  font-size: 0.92rem;
  color: #64748B;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════
   AUTH BANNER
   ══════════════════════════════════════════════ */
.auth-banner {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 1px solid #DBEAFE;
  border-top: 3px solid #0066FF;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.auth-banner > i { font-size: 1.4rem; color: #0052CC; flex-shrink: 0 }
.auth-banner-text { flex: 1; min-width: 200px }
.auth-banner-text h4 { font-size: 0.9rem; font-weight: 700; color: #1a1a1a; margin-bottom: 0.2rem }
.auth-banner-text p { font-size: 0.82rem; color: #64748B; margin: 0 }
.auth-banner-text code {
  background: #DBEAFE;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #1D4ED8;
  font-weight: 600;
}
.auth-banner a {
  background: #0066FF;
  color: white;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}
.auth-banner a:hover { background: #0052CC; color: white; text-decoration: none }

/* ══════════════════════════════════════════════
   GLOBAL LANGUAGE BAR (sticky)
   ══════════════════════════════════════════════ */
.global-lang-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  position: sticky;
  top: 0.5rem;
  z-index: 90;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.global-lang-bar.stuck {
  box-shadow: 0 4px 20px rgba(15,23,42,0.1);
  border-color: #BFDBFE;
}
.global-lang-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}
.global-lang-bar-label i { color: #0066FF; font-size: 0.72rem }
.global-lang-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.global-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.global-lang-btn:hover { border-color: #BFDBFE; color: #0052CC; background: #EFF6FF }
.global-lang-btn.active {
  background: #0066FF;
  border-color: #0066FF;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,102,255,0.25);
}
.global-lang-hint { font-size: 0.72rem; color: #94A3B8; margin: 0; flex-basis: 100% }
.global-lang-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-family: inherit;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  box-shadow: 0 1px 0 #CBD5E1;
  color: #475569;
}

/* ══════════════════════════════════════════════
   SETUP BLOCK
   ══════════════════════════════════════════════ */
.setup-block {
  background: #0F172A;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 2rem;
  border: 1px solid #1E293B;
}
.setup-block-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #60A5FA;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.setup-block pre {
  margin: 0;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: clamp(0.7rem, 1.4vw, 0.8rem);
  line-height: 1.7;
  color: #CBD5E1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}

/* ══════════════════════════════════════════════
   OVERVIEW GRID (API cards)
   ══════════════════════════════════════════════ */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0;
}
.overview-card {
  background: white;
  border-radius: 12px;
  padding: 1.1rem 0.85rem;
  border: 1px solid #E2E8F0;
  border-top: 3px solid transparent;
  text-align: center;
  transition: all 0.25s ease;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}
.overview-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.55) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.45s ease;
  pointer-events: none;
}
.overview-card:hover::after { transform: translateX(100%) }
.overview-card:hover {
  border-color: #0052CC;
  box-shadow: 0 4px 18px rgba(0,102,255,0.1);
  transform: translateY(-3px);
  text-decoration: none;
}
.overview-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  margin: 0 auto 0.6rem;
  background: linear-gradient(135deg, #0066FF 0%, #00C48C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}
.overview-card h4 { font-size: 0.8rem; font-weight: 700; color: #1a1a1a; margin-bottom: 0.2rem }
.overview-card p { font-size: 0.72rem; color: #64748B; margin: 0 }
.overview-card .card-code {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #3730a3;
  background: #EEF2FF;
  border-radius: 20px;
  padding: 0.1rem 0.5rem;
  margin-top: 0.35rem;
  font-family: 'Fira Code', monospace;
}

/* Per-API card colors */
.overview-card[href="#liveness"]        { border-top-color: #2563EB }
.overview-card[href="#liveness"] .overview-card-icon { background: linear-gradient(135deg, #2563EB, #1d4ed8) }
.overview-card[href="#face-recognition"]{ border-top-color: #7C3AED }
.overview-card[href="#face-recognition"] .overview-card-icon { background: linear-gradient(135deg, #7C3AED, #6D28D9) }
.overview-card[href="#id-card-ocr"]     { border-top-color: #4338CA }
.overview-card[href="#id-card-ocr"] .overview-card-icon { background: linear-gradient(135deg, #4338CA, #3730A3) }
.overview-card[href="#lao-ocr"]         { border-top-color: #0891B2 }
.overview-card[href="#lao-ocr"] .overview-card-icon { background: linear-gradient(135deg, #0891B2, #0e7490) }
.overview-card[href="#license-plate"]   { border-top-color: #D97706 }
.overview-card[href="#license-plate"] .overview-card-icon { background: linear-gradient(135deg, #D97706, #B45309) }
.overview-card[href="#ekyc"]            { border-top-color: #059669 }
.overview-card[href="#ekyc"] .overview-card-icon { background: linear-gradient(135deg, #059669, #047857) }
.overview-card[href="#package-mgmt"]    { border-top-color: #475569 }
.overview-card[href="#package-mgmt"] .overview-card-icon { background: linear-gradient(135deg, #475569, #334155) }

/* ══════════════════════════════════════════════
   ENDPOINT INFO BAR
   ══════════════════════════════════════════════ */
.endpoint-info-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(90deg, #F0F7FF 0%, #F8FAFC 100%);
  border: 1px solid #E2E8F0;
  border-left: 3px solid #0066FF;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.endpoint-url {
  font-family: 'Fira Code', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F172A;
  word-break: break-all;
  flex: 1;
}
.content-type-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: #FEF3C7;
  color: #B45309;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.copy-url-btn {
  background: none;
  border: 1px solid #CBD5E1;
  color: #64748B;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.2s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 34px;
}
.copy-url-btn:hover { background: white; border-color: #0052CC; color: #0052CC }
.copy-url-btn.copied { background: #DCFCE7; border-color: #14532d; color: #14532d }

/* Method badges */
.method-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: monospace;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.method-post { background: #DCFCE7; color: #15803D }
.method-get  { background: #DBEAFE; color: #1D4ED8 }

/* Sub-endpoint tabs */
.sub-endpoint-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.sub-tab {
  padding: 0.5rem 1.1rem;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  background: white;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}
.sub-tab.active { background: #0066FF; color: white; border-color: #0052CC }
.sub-tab:hover:not(.active) { border-color: #0052CC; color: #0052CC }

/* ══════════════════════════════════════════════
   CODE BLOCK WRAPPER — TABS + PANELS
   ══════════════════════════════════════════════ */
.code-block-wrapper {
  margin-bottom: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Tabs row */
.code-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #E2E8F0;
  overflow-x: auto;
  scrollbar-width: none;
  background: #F8FAFC;
  padding: 0 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.code-tabs::-webkit-scrollbar { display: none }
.code-tab {
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748B;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  scroll-snap-align: start;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.code-tab.active { color: #0052CC; border-bottom-color: #0052CC }
.code-tab:hover:not(.active) { color: #374151 }
.code-tab .tab-icon { font-size: 0.8rem; margin-right: 0.35rem; line-height: 1 }

/* Language-specific tab colors */
.code-tab[data-lang=python].active     { color: #3B82F6; border-bottom-color: #3B82F6 }
.code-tab[data-lang=java].active       { color: #EA580C; border-bottom-color: #EA580C }
.code-tab[data-lang=javascript].active { color: #F59E0B; border-bottom-color: #F59E0B }
.code-tab[data-lang=curl].active       { color: #8B5CF6; border-bottom-color: #8B5CF6 }
.code-tab[data-lang=postman].active    { color: #FF6C37; border-bottom-color: #FF6C37 }

/* Code panels */
.code-panel { display: none }
.code-panel.active { display: block }

/* Code block (dark terminal) */
.code-block {
  background: linear-gradient(180deg, #0F172A 0%, #111827 100%);
  padding: 2.8rem 1.35rem 1.35rem;
  overflow-x: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  transition: box-shadow 0.2s ease;
}
.code-block-wrapper:hover .code-block {
  box-shadow: inset 0 0 30px rgba(0,102,255,0.03);
}
.code-block::before {
  content: '● ● ●';
  position: absolute;
  top: 0.7rem;
  left: 0.85rem;
  font-size: 0.55rem;
  letter-spacing: 0.25rem;
  color: rgba(255,255,255,0.2);
  pointer-events: none;
  line-height: 1;
}
.code-block pre {
  margin: 0;
  font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  line-height: 1.75;
  color: #E2E8F0;
  white-space: pre;
  tab-size: 4;
}
.code-block .kw { color: #93C5FD }
.code-block .str { color: #86EFAC }
.code-block .cm { color: #4B5563 }
.code-block .fn { color: #FDE68A }
.code-block .nm { color: #F9A8D4 }

/* Copy button */
.copy-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #94A3B8;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
  white-space: nowrap;
}
.copy-btn:hover { background: rgba(255,255,255,0.14); color: white }
.copy-btn.copied { background: rgba(22,163,74,0.2); border-color: #14532d; color: #4ADE80 }

/* Postman actions bar (below code block) */
.postman-actions {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.postman-download-btn {
  background: #FF6C37;
  border: none;
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.postman-download-btn:hover { background: #e55a2b; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(255,108,55,0.3) }
.postman-download-btn.copied { background: #16a34a; color: #fff }
.postman-actions-hint {
  font-size: 0.74rem;
  color: #9A3412;
  line-height: 1.4;
}

/* Postman-specific code block accent */
.code-block--postman { border-top: 3px solid #FF6C37; border-radius: 0 0 0 0 }

/* ══════════════════════════════════════════════
   RESPONSE BOX
   ══════════════════════════════════════════════ */
.response-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #10B981;
  border-radius: 10px;
  margin-top: 0.5rem;
}
.response-box-label {
  background: #F1F5F9;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.5rem 1rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748B;
  letter-spacing: 0.04em;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.response-box-label i { color: #10B981 }
.response-box pre {
  margin: 0;
  padding: 1rem 1.1rem;
  font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  line-height: 1.7;
  color: #334155;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 10px 10px;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}
.response-box pre::-webkit-scrollbar { height: 4px }
.response-box pre::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px }
.response-box .str { color: #059669 }
.response-box .nm { color: #2563EB }

/* ══════════════════════════════════════════════
   ALL ENDPOINTS GRID
   ══════════════════════════════════════════════ */
.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 0;
}
.endpoint-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #E2E8F0;
  border-left: 3px solid transparent;
  transition: all 0.25s ease;
  text-decoration: none;
  display: block;
}
.endpoint-card:hover {
  border-color: #0052CC;
  border-left-color: #0066FF;
  box-shadow: 0 4px 18px rgba(0,102,255,0.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.endpoint-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.endpoint-path {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a1a1a;
  font-family: 'Fira Code', monospace;
  word-break: break-all;
}
.endpoint-desc { font-size: 0.82rem; color: #64748B; line-height: 1.45; margin-bottom: 0.75rem }
.endpoint-tags { display: flex; flex-wrap: wrap; gap: 0.35rem }
.endpoint-tag {
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  background: #EFF6FF;
  color: #1D4ED8;
}

/* ══════════════════════════════════════════════
   DOCS CTA (bottom)
   ══════════════════════════════════════════════ */
.docs-cta {
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  border-radius: 18px;
  padding: 2.5rem;
  text-align: center;
  color: white;
}
.docs-cta h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 800; margin-bottom: 0.6rem }
.docs-cta p { font-size: 0.95rem; color: rgba(255,255,255,0.85); margin-bottom: 1.5rem }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap }
.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: #0052CC;
  padding: 0.7rem 1.6rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  min-height: 46px;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.18); color: #0052CC; text-decoration: none }
.btn-outline-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
  padding: 0.7rem 1.6rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  min-height: 46px;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.1); border-color: white; color: white; text-decoration: none }

/* ══════════════════════════════════════════════
   SECTION DIVIDER (between API sections)
   ══════════════════════════════════════════════ */
.docs-main section + section::before {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #0066FF, transparent);
  border-radius: 3px;
  margin-bottom: 2rem;
  opacity: 0.4;
}

/* ══════════════════════════════════════════════
   BACK TO TOP
   ══════════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #0066FF;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(0,102,255,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 500;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0) }
.back-to-top:hover { background: #0052CC; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,102,255,0.5) }

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET (<=1280px)
   ══════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .docs-layout { grid-template-columns: 230px 1fr }
  .docs-main { padding: 2rem 2rem 3rem }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — SMALL TABLET (<=1024px)
   ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .docs-layout { grid-template-columns: 210px 1fr }
  .docs-main { padding: 1.75rem 1.5rem 3rem }
  .endpoints-grid { grid-template-columns: 1fr }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE (<=768px)
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .docs-main section { scroll-margin-top: 60px }
  .docs-nav-toggle { display: flex }
  .docs-layout { grid-template-columns: 1fr }

  .docs-sidebar {
    position: static;
    height: auto;
    max-height: 0;
    overflow: hidden;
    border-right: none;
    border-bottom: 1px solid #E2E8F0;
    padding: 0;
    transition: max-height 0.3s ease, padding 0.2s ease;
  }
  .docs-sidebar.sidebar-open {
    max-height: 70vh;
    padding: 0.75rem 0 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0 0.75rem;
  }
  .sidebar-section { margin-bottom: 0.4rem; padding: 0 }
  .sidebar-label { display: none }
  .sidebar-link { font-size: 0.8rem; padding: 0.5rem 0.8rem; min-height: 40px; border-radius: 8px }
  .sidebar-cta { padding: 0.5rem 0.75rem 0 }
  .sidebar-cta-btn { max-width: 200px }

  .docs-main { padding: 1.5rem 1rem 2.5rem }
  .section-title { font-size: 1.2rem }
  .overview-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) }
  .endpoints-grid { grid-template-columns: 1fr }

  .hero-stats { gap: 0.45rem }
  .hero-stat { font-size: 0.72rem; padding: 0.3rem 0.65rem }
  .auth-banner { padding: 1rem 1.1rem; gap: 0.75rem }
  .auth-banner-text { min-width: 0 }
  .endpoint-info-bar { padding: 0.6rem 0.8rem; gap: 0.5rem }
  .endpoint-url { font-size: 0.82rem }

  .code-tab { padding: 0.6rem 0.85rem; font-size: 0.78rem; min-height: 44px }
  .code-tabs {
    padding: 0 0.25rem;
    mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
  }

  .global-lang-bar { padding: 0.75rem 0.85rem; gap: 0.55rem; position: sticky; top: 0; border-radius: 0; margin: 0 -1rem 1.5rem; width: calc(100% + 2rem) }
  .global-lang-bar-label { width: 100% }
  .global-lang-buttons { width: 100% }
  .global-lang-btn {
    flex: 1 1 calc(33.33% - 0.35rem);
    justify-content: center;
    min-width: 0;
    padding: 0.45rem 0.5rem;
    font-size: 0.72rem;
    min-height: 40px;
  }

  .postman-actions { padding: 0.65rem 0.85rem }
  .postman-download-btn { width: 100%; justify-content: center }
  .postman-hint { font-size: 0.72rem; padding: 0.6rem 0.85rem }

  .back-to-top { bottom: 1.25rem; right: 1.25rem; width: 42px; height: 42px }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (<=480px)
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .samples-hero { padding: 3rem 0 2.5rem }
  .samples-hero h1 { font-size: 1.5rem }
  .hero-cta-row { flex-direction: column; align-items: stretch }
  .hero-btn-primary, .hero-btn-ghost { justify-content: center }
  .hero-meta { flex-direction: column; gap: 0.4rem; align-items: center }

  .overview-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem }

  .docs-cta { padding: 1.75rem 1rem }
  .cta-buttons { flex-direction: column; align-items: center }
  .btn-white, .btn-outline-white { width: 100%; justify-content: center }

  .sub-endpoint-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sub-endpoint-tabs::-webkit-scrollbar { display: none }
  .sub-tab { flex-shrink: 0; padding: 0.5rem 0.8rem; font-size: 0.8rem }

  .code-block { padding: 2.5rem 0.85rem 1rem }
  .code-block pre { font-size: 0.7rem }
  .copy-btn { top: 0.5rem; right: 0.5rem; padding: 0.3rem 0.55rem; min-height: 34px; font-size: 0.68rem }

  .global-lang-btn { flex: 1 1 calc(50% - 0.25rem) }
  .setup-block { padding: 0.85rem }
  .endpoint-info-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem }

  .section-title { font-size: 1.1rem; flex-direction: column; align-items: flex-start }
  .section-title .try-live-link { align-self: flex-start }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — VERY SMALL (<=360px)
   ══════════════════════════════════════════════ */
@media (max-width: 360px) {
  .docs-main { padding: 1rem 0.75rem 2rem }
  .samples-hero { padding: 2.5rem 0 2rem }
  .samples-hero .container { padding: 0 1rem }
  .samples-hero h1 { font-size: 1.35rem }
  .overview-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem }
  .overview-card { padding: 0.85rem 0.6rem }
  .overview-card h4 { font-size: 0.72rem }
  .code-tab { padding: 0.5rem 0.6rem; font-size: 0.72rem }
  .global-lang-btn { flex: 1 1 100%; font-size: 0.72rem }
}

/* ══════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════ */
@media print {
  .docs-sidebar, .docs-nav-toggle, .back-to-top,
  .hero-cta-row, .sidebar-cta, .copy-btn, .download-btn,
  .copy-url-btn, .global-lang-bar { display: none !important }
  .docs-layout { grid-template-columns: 1fr !important }
  .docs-main { max-width: 100% !important; padding: 1rem !important }
  .code-panel { display: block !important }
  .code-block { background: #f5f5f5 !important; color: #333 !important; border: 1px solid #ddd }
  .samples-hero { background: #f5f5f5 !important; color: #333 !important }
}

/* ══════════════════════════════════════════════
   ACCESSIBILITY — FOCUS STYLES
   ══════════════════════════════════════════════ */
.code-tab:focus-visible,
.global-lang-btn:focus-visible,
.sub-tab:focus-visible,
.sidebar-link:focus-visible,
.copy-btn:focus-visible,
.postman-download-btn:focus-visible {
  outline: 2px solid #0066FF;
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .docs-main section { animation: none }
  .overview-card::after { display: none }
  .back-to-top { transition: opacity 0.1s }
  * { transition-duration: 0.01ms !important }
}
