/* TrackMe Enterprise Developer Documentation Stylesheet
 * Crisp light documentation canvas (Stripe / AfterShip aesthetic) + dark terminal code blocks
 * 100% mobile responsive with slide-over navigation drawer
 */

@import url('https://fonts.googleapis.com/css2?family=Host+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --docs-navy: #0b132b;
  --docs-bg: #ffffff;
  --docs-sidebar-bg: #f8fafc;
  --docs-surface: #ffffff;
  --docs-border: #e2e8f0;
  --docs-border-subtle: #f1f5f9;
  --docs-text: #0f172a;
  --docs-body: #334155;
  --docs-muted: #64748b;
  --docs-blue: #2563eb;
  --docs-purple: #863bff;
  --docs-cyan: #0ea5e9;
  --docs-gradient: linear-gradient(135deg, #863bff 0%, #2563eb 60%, #47bfff 100%);
  --docs-code-bg: #0b132b;
  --docs-code-head: #111b3a;
  --docs-code-border: rgba(255, 255, 255, 0.1);
  --docs-radius: 14px;
  --docs-radius-sm: 8px;
  --docs-header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: 'Host Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--docs-bg);
  color: var(--docs-body);
  line-height: 1.65;
  font-size: 15px;
  overflow-x: hidden;
}
a { color: inherit; }

/* =========================================
   TOP ENTERPRISE HEADER (White Brand Navbar)
   ========================================= */
header.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--docs-header-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--docs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-logo-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-group img {
  height: 34px;
  width: auto;
  display: block;
}

.header-version-pill {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.docs-top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-top-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: color 0.16s ease;
}
.docs-top-nav a:hover,
.docs-top-nav a.active {
  color: var(--docs-navy);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-link-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-outline-white {
  border: 1px solid #cbd5e1;
  color: var(--docs-navy);
  background: #ffffff;
}
.btn-outline-white:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.btn-primary-blue {
  background: var(--docs-gradient);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 8px 20px -8px rgba(134, 59, 255, 0.55);
}
.btn-primary-blue:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.65);
}

.mobile-menu-toggle {
  display: none;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--docs-navy);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-toggle:hover { background: #f1f5f9; }

/* =========================================
   LAYOUT GRID & SIDEBAR
   ========================================= */
.docs-container {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
  min-height: calc(100vh - var(--docs-header-h));
}

aside.docs-sidebar {
  position: sticky;
  top: var(--docs-header-h);
  height: calc(100vh - var(--docs-header-h));
  overflow-y: auto;
  padding: 20px 18px 40px;
  border-right: 1px solid var(--docs-border);
  background: var(--docs-sidebar-bg);
}

.docs-sidebar-search {
  position: relative;
  margin-bottom: 18px;
}
.docs-sidebar-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--docs-text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.docs-sidebar-search input:focus {
  border-color: var(--docs-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.docs-sidebar-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 22px 0 8px 10px;
}
.sidebar-section-title:first-of-type { margin-top: 4px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}
.sidebar-link:hover {
  background: #e2e8f0;
  color: var(--docs-navy);
}
.sidebar-link.active {
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}

.http-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.http-get { background: #dcfce7; color: #15803d; }
.http-post { background: #dbeafe; color: #1d4ed8; }
.http-delete { background: #fee2e2; color: #b91c1c; }

.sidebar-mobile-close {
  display: none;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid var(--docs-border);
  color: var(--docs-navy);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
}

.docs-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 43, 0.55);
  backdrop-filter: blur(3px);
  z-index: 55;
}
.docs-sidebar-backdrop.active { display: block; }

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
main.docs-content {
  padding: 44px 56px 96px;
  max-width: 980px;
  width: 100%;
  min-width: 0;
}

.hero-section {
  margin-bottom: 44px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--docs-border);
}

.docs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  color: #6d28d9;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 800;
  color: var(--docs-navy);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 14px;
}
.hero-subtitle {
  font-size: 1.04rem;
  color: var(--docs-body);
  line-height: 1.65;
  margin: 0 0 24px;
}

.docs-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0 24px;
}
.docs-meta-card {
  background: #f8fafc;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.docs-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--docs-muted);
  margin-bottom: 4px;
}
.docs-meta-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--docs-navy);
  word-break: break-all;
}

.doc-section {
  margin-bottom: 56px;
  scroll-margin-top: 94px;
}
.doc-heading, .doc-section > h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.65rem);
  font-weight: 800;
  color: var(--docs-navy);
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.doc-subheading, .doc-section h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--docs-navy);
  margin: 24px 0 10px;
}
.doc-section h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--docs-navy);
  margin: 20px 0 10px;
}
p { margin: 0 0 15px; color: var(--docs-body); }

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84em;
  background: #f1f5f9;
  color: #1e293b;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  word-break: break-word;
}
pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  word-break: normal;
}

.section-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.badge-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* =========================================
   ENDPOINT CARDS & CALLOUTS
   ========================================= */
.endpoint-card {
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.12);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.endpoint-url-bar {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--docs-navy);
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  word-break: break-all;
}

.callout {
  border-radius: 12px;
  padding: 16px 20px;
  margin: 18px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.55;
}
.callout-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}
.callout-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.callout-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.callout-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.docs-playground-banner {
  background: var(--docs-navy);
  color: #ffffff;
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.docs-playground-banner p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: #cbd5e1;
}

/* =========================================
   TABLES (100% Mobile Scrollable)
   ========================================= */
.table-responsive, .table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 22px;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  background: #ffffff;
}
.params-table, .endpoint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 520px;
}
.params-table th, .endpoint-table th {
  text-align: left;
  padding: 11px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--docs-border);
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}
.params-table td, .endpoint-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--docs-border-subtle);
  vertical-align: top;
  color: var(--docs-body);
}
.params-table tr:last-child td, .endpoint-table tr:last-child td {
  border-bottom: none;
}

.param-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #1d4ed8;
}
.param-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #7c3aed;
}
.param-required {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  display: inline-block;
}
.param-optional {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  display: inline-block;
}

/* =========================================
   DARK TERMINAL CODE BLOCKS
   ========================================= */
.code-block-wrapper, .code-block-container {
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-code-border);
  border-radius: 12px;
  margin: 14px 0 22px;
  overflow: hidden;
  box-shadow: 0 12px 28px -16px rgba(11, 19, 43, 0.45);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--docs-code-head);
  border-bottom: 1px solid var(--docs-code-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  flex-wrap: wrap;
}
.code-block-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
  padding: 2px 8px;
  border-radius: 4px;
}

.btn-copy-code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.16s ease;
}
.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

pre.code-content, pre.code-pre {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.82rem;
  padding: 16px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  color: #e2e8f0;
  line-height: 1.55;
  margin: 0;
  white-space: pre;
}

/* Status pills */
.status-pill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.st-pending { background: #f1f5f9; color: #334155; }
.st-transit { background: #dbeafe; color: #1d4ed8; }
.st-out { background: #fef3c7; color: #b45309; }
.st-delivered { background: #dcfce7; color: #15803d; }
.st-failed { background: #fee2e2; color: #b91c1c; }

/* =========================================
   RESPONSIVE BREAKPOINTS (Tablet & Mobile)
   ========================================= */
@media (max-width: 1120px) {
  .docs-top-nav { display: none; }
  .docs-meta-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .mobile-menu-toggle { display: inline-flex; }
  .docs-container { grid-template-columns: 1fr; }
  aside.docs-sidebar {
    position: fixed;
    top: 0;
    left: -310px;
    bottom: 0;
    width: 300px;
    max-width: 86vw;
    height: 100vh;
    z-index: 60;
    background: #ffffff;
    box-shadow: 10px 0 32px rgba(15, 23, 42, 0.25);
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  aside.docs-sidebar.open { left: 0; }
  .sidebar-mobile-close { display: flex; }
  main.docs-content {
    padding: 26px 20px 72px;
    max-width: 100%;
  }
  header.docs-header { padding: 0 16px; }
  .header-version-pill { display: none; }
  .endpoint-card { padding: 18px; }
}

@media (max-width: 600px) {
  .docs-meta-strip { grid-template-columns: 1fr; }
  .btn-outline-white { display: none !important; }
  .btn-link-action { padding: 8px 13px; font-size: 0.8rem; }
  .btn-link-action .btn-text-full { display: none; }
  .docs-playground-banner { padding: 18px; }
  .callout { padding: 14px 16px; }
  pre.code-content, pre.code-pre { font-size: 0.77rem; padding: 14px; }
}

