/* UptimeLock Developers — Apple / Mintlify / Linear Inspired Documentation System */

:root {
  --bg-pure: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-elevated: #fbfbfd;
  --bg-glass: rgba(255, 255, 255, 0.86);
  --bg-code: #0f1117;
  --bg-code-head: #171923;

  --text-primary: #1d1d1f;
  --text-secondary: #515154;
  --text-muted: #6e6e73;

  --accent-blue: #0066cc;
  --accent-blue-hover: #0055b3;
  --accent-blue-soft: rgba(0, 102, 204, 0.08);
  --accent-emerald: #10b981;
  --accent-emerald-text: #047857;
  --accent-emerald-soft: rgba(16, 185, 129, 0.12);
  --accent-amber-text: #b45309;
  --accent-amber-soft: rgba(245, 158, 11, 0.14);
  --accent-rose-text: #b91c1c;
  --accent-rose-soft: rgba(239, 68, 68, 0.12);

  --border-light: rgba(0, 0, 0, 0.07);
  --border-medium: rgba(0, 0, 0, 0.12);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 9999px;

  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 6px 24px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 16px 42px rgba(0, 0, 0, 0.07);

  --nav-height: 64px;
  --sidebar-width: 268px;
  --ease-apple: cubic-bezier(0.25, 1, 0.5, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-pure);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15.5px;
  overflow-x: hidden;
}

code, pre, .mono {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

button, input {
  font-family: inherit;
  font-size: inherit;
}

/* Inline code badges inside paragraphs */
p code, .param-desc code, td code {
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

/* ==========================================================================
   Sticky Frosted Top Navbar (Matches www)
   ========================================================================== */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--border-light);
}

.docs-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1d1d1f 0%, #343438 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.dev-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* Search Bar in Topbar */
.docs-search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.docs-search-input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-soft);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s var(--ease-apple);
}

.docs-search-input:focus {
  background: var(--bg-pure);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.docs-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.docs-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease-apple);
  white-space: nowrap;
}

.btn-dark {
  background: var(--text-primary);
  color: #ffffff;
}

.btn-dark:hover {
  background: #000000;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.mobile-docs-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-soft);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   Clean Pure-White Sidebar + Wide Editorial Stream (Apple Developer Style)
   ========================================================================== */
.docs-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

/* Minimal Pure White Sidebar with crisp left indicator (No ugly grey box!) */
.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  max-height: calc(100dvh - var(--nav-height) - 56px);
  overflow-y: auto;
  padding: 4px 16px 32px 0;
  border-right: 1px solid var(--border-light);
  scrollbar-width: none;
}

.docs-sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-group {
  margin-bottom: 28px;
}

.sidebar-group:last-child {
  margin-bottom: 0;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border-light);
  margin-left: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.16s ease;
}

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

.sidebar-link.active {
  color: var(--accent-blue);
  font-weight: 600;
  border-left-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.method-dot {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.02em;
}

.method-get {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-text);
}

.method-post {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.method-del {
  background: var(--accent-rose-soft);
  color: var(--accent-rose-text);
}

/* ==========================================================================
   Main Content Stream (Wide, Clean, Never Cramped)
   ========================================================================== */
.docs-main {
  padding: 40px 0 96px;
  max-width: 880px;
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-emerald-text);
  background: var(--accent-emerald-soft);
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.docs-hero-title {
  font-size: clamp(2.3rem, 4.2vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin-bottom: 16px;
}

.text-gradient {
  background: linear-gradient(135deg, #1d1d1f 10%, #0066cc 60%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-lead {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.62;
}

/* Interactive Token Playground Bar */
.token-playground-card {
  margin-top: 32px;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.token-input-group {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 280px;
}

.token-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-medium);
  background: var(--bg-pure);
  font-size: 13px;
  outline: none;
}

.token-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

/* Documentation Sections */
.doc-section {
  padding-top: 52px;
  margin-top: 52px;
  border-top: 1px solid var(--border-light);
}

.doc-section-head {
  margin-bottom: 24px;
}

.doc-section h2 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.doc-section p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}

/* ==========================================================================
   Full-Width Stacked Endpoint Cards (Zero Horizontal Scrollbar!)
   ========================================================================== */
.endpoint-card {
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 30px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease-apple), border-color 0.25s var(--ease-apple);
}

.endpoint-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

/* Stacked layout: Specs on top, Full-width macOS Terminal below */
.endpoint-split {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.endpoint-route-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  padding: 5px 14px 5px 7px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-http {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badge-http.get { background: var(--accent-emerald-soft); color: var(--accent-emerald-text); }
.badge-http.post { background: var(--accent-blue-soft); color: var(--accent-blue); }
.badge-http.delete { background: var(--accent-rose-soft); color: var(--accent-rose-text); }

.endpoint-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

/* Parameter Rows */
.param-list {
  margin-top: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 4px 18px;
}

.param-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
}

.param-row:last-child {
  border-bottom: 0;
}

.param-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.param-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13.5px;
}

.param-type {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  padding: 1px 7px;
  border-radius: 6px;
}

.param-req {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-rose-text);
  background: var(--accent-rose-soft);
  padding: 1px 7px;
  border-radius: 6px;
}

.param-opt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.param-desc {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* ==========================================================================
   Full-Width macOS Dark Code Window (Clean, No Ugly Scrollbars!)
   ========================================================================== */
.code-studio {
  width: 100%;
  background: var(--bg-code);
  color: #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
}

.code-studio-top {
  background: var(--bg-code-head);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.code-lang-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.code-lang-tabs::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
  margin-right: 42px;
  display: inline-block;
}

.code-lang-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.code-lang-btn:hover {
  color: #ffffff;
}

.code-lang-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.code-copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.code-pre {
  padding: 20px 22px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  margin: 0;
  color: #a7f3d0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.code-pre::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.code-pre::-webkit-scrollbar-track {
  background: transparent;
}

.code-pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
}

.code-response-title {
  padding: 8px 22px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-pre.json-out {
  color: #93c5fd;
  max-height: 260px;
}

/* Status Codes Grid */
.status-codes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.status-code-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 18px;
}

/* Quick Endpoints Summary Table */
.catalog-table-wrap {
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-top: 20px;
  box-shadow: var(--shadow-xs);
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.catalog-table th,
.catalog-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.catalog-table th {
  background: var(--bg-elevated);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.catalog-table tr:last-child td {
  border-bottom: 0;
}

.catalog-table tbody tr:hover {
  background: var(--bg-elevated);
}

/* Docs Footer */
.docs-footer {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Mobile Slide-Over Sidebar */
.docs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.35);
  backdrop-filter: blur(5px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.docs-backdrop.open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1024px) {
  .status-codes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .docs-shell {
    grid-template-columns: 1fr;
    padding: 0 20px;
    gap: 0;
  }
  .mobile-docs-btn {
    display: inline-flex;
  }
  .docs-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: min(86vw, 320px);
    max-height: none;
    height: 100dvh;
    z-index: 1600;
    border-right: 0;
    border-left: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    padding: 28px 20px 40px;
    transform: translateX(104%);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.14);
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }
  .docs-main {
    padding: 32px 0 64px;
  }
  .endpoint-card {
    padding: 22px 18px;
  }
  .status-codes-grid {
    grid-template-columns: 1fr;
  }
  .code-lang-tabs::before {
    display: none;
  }
}
