/* ============================================================
   CLIA Member Validation API — Documentation Styles
   ============================================================ */

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand */
  --clia-blue: #003366;
  --clia-blue-light: #004a99;
  --clia-blue-dark: #001f3d;
  --accent: #0473c8;
  --accent-hover: #035ea3;
  --accent-light: #e8f3fc;
  --accent-border: #bcdcf5;

  /* Surfaces */
  --bg: #f6f8fa;
  --bg-white: #ffffff;
  --bg-raised: #fcfdfe;

  /* Text */
  --text: #16243a;
  --text-secondary: #4b5b71;
  --text-light: #7a8699;

  /* Lines */
  --border: #e3e8ee;
  --border-strong: #d2dae3;

  /* Code */
  --code-bg: #f0f3f7;
  --code-text: #0b4f8a;
  --code-block-bg: #0e1726;
  --code-block-header: #131e30;
  --code-block-text: #dbe4f0;

  /* Semantics */
  --success: #0e9f5d;
  --success-bg: #e4f7ee;
  --warning: #c77800;
  --warning-bg: #fdf3e1;
  --error: #d62f3f;
  --error-bg: #fdecee;

  /* Layout */
  --sidebar-width: 284px;
  --header-height: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(22, 36, 58, 0.05), 0 1px 4px rgba(22, 36, 58, 0.05);
  --shadow-md: 0 4px 12px rgba(22, 36, 58, 0.08), 0 2px 4px rgba(22, 36, 58, 0.05);
  --shadow-lg: 0 12px 28px rgba(22, 36, 58, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

::selection {
  background: var(--accent-light);
  color: var(--clia-blue);
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(120deg, var(--clia-blue-dark) 0%, var(--clia-blue) 55%, #00498f 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 24, 51, 0.35);
}

.header::after {
  /* subtle accent line under the header */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #2aa4e8 0%, rgba(42, 164, 232, 0) 60%);
  opacity: 0.85;
}

.header-logo {
  height: 38px;
  margin-right: 16px;
}

.header-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.header-title a {
  color: #fff;
  text-decoration: none;
}

.header-title a:hover {
  text-decoration: none;
  opacity: 0.92;
  color: #fff;
}

.header-subtitle {
  font-size: 12px;
  opacity: 0.65;
  margin-left: 12px;
  font-weight: 400;
}

.header-version {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #d8ecff;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  margin-right: 12px;
  padding: 4px 8px;
  border-radius: 6px;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 28px 0 40px;
  z-index: 90;
  transition: transform 0.28s ease;
}

.sidebar-section {
  padding: 0 18px;
  margin-bottom: 28px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 10px;
  padding: 0 12px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-secondary);
  border-radius: 7px;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-nav li a:hover {
  background: var(--accent-light);
  color: var(--accent-hover);
  text-decoration: none;
}

.sidebar-nav li a.active {
  background: var(--accent-light);
  color: var(--accent-hover);
  font-weight: 600;
  border-left-color: var(--accent);
}

.sidebar-nav .method-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.method-get {
  background: #dcebfb;
  color: #135ca4;
}

.method-post {
  background: #dcf5e7;
  color: #11744a;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.45);
  backdrop-filter: blur(2px);
  z-index: 85;
}

/* ===== Main Content ===== */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 44px 52px 88px;
  max-width: 980px;
}

/* ===== Typography ===== */
h1 {
  font-size: 31px;
  font-weight: 750;
  color: var(--clia-blue);
  margin-bottom: 10px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

h2 {
  font-size: 21px;
  font-weight: 650;
  color: var(--text);
  margin-top: 52px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-strong);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  margin-top: 34px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 26px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 720px;
}

/* ===== Endpoint Header ===== */
.endpoint-header {
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.endpoint-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #2aa4e8, var(--clia-blue));
}

.endpoint-method-path {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.endpoint-method {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.endpoint-path {
  font-size: 19px;
  font-weight: 650;
  font-family: var(--font-mono);
  color: var(--text);
  letter-spacing: -0.01em;
}

.endpoint-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* ===== Base URL ===== */
.base-url {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px 8px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.base-url code {
  background: none;
  padding: 0;
  color: var(--clia-blue);
  font-weight: 550;
}

.base-url-label {
  font-weight: 700;
  color: #fff;
  background: var(--clia-blue);
  font-family: var(--font-sans);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 999px;
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-white);
}

thead {
  background: var(--bg-raised);
}

th {
  text-align: left;
  padding: 11px 16px;
  font-weight: 650;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: #f7fafd;
}

td code {
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-weight: 500;
}

.required-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--error);
  background: var(--error-bg);
  padding: 2px 8px;
  border-radius: 999px;
}

.optional-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  background: var(--code-bg);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ===== Membership Type Pills (conventions matrix) ===== */
.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-agent {
  background: #dcebfb;
  color: #135ca4;
}

.pill-agency {
  background: #dcf5e7;
  color: #11744a;
}

.pill-nonmember {
  background: #edeff3;
  color: #5b6677;
}

.pill-na {
  background: transparent;
  color: var(--text-light);
  font-weight: 450;
}

/* ===== Code Blocks ===== */
.code-block {
  background: var(--code-block-bg);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #1d2c45;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: var(--code-block-header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.code-block-title {
  font-size: 11.5px;
  font-weight: 650;
  color: #8da4c4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #9fb3d1;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #e8eef7;
  border-color: rgba(255, 255, 255, 0.25);
}

.code-block pre {
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--code-block-text);
}

.code-block pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* JSON syntax highlighting */
.json-key { color: #79c0ff; }
.json-string { color: #7ee0a3; }
.json-number { color: #ffc66d; }
.json-bool { color: #d2a8ff; }
.json-null { color: #ff9eb6; font-style: italic; }
.json-comment { color: #5d738f; font-style: italic; }

/* ===== Inline Code ===== */
code {
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--code-text);
}

/* ===== Cards ===== */
.endpoint-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 8px;
}

.card {
  position: relative;
  height: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.card::after {
  content: '\2192';
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--border-strong);
  font-size: 16px;
  transition: color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.card:hover::after {
  color: var(--accent);
  transform: translateX(3px);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.card-link:hover {
  text-decoration: none;
}

.card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  padding-right: 24px;
}

.card-title .method-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 8px;
  font-family: var(--font-mono);
  vertical-align: 1px;
}

.card-description {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
  font-family: var(--font-sans);
}

/* ===== Callouts ===== */
.callout {
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
  border: 1px solid;
  border-left-width: 4px;
}

.callout-info {
  background: #eef6fd;
  border-color: #b9dcf6;
  border-left-color: #2d8fd8;
  color: #144d7e;
}

.callout-warning {
  background: var(--warning-bg);
  border-color: #f3ddb0;
  border-left-color: #e09112;
  color: #7c5000;
}

.callout-note {
  background: var(--success-bg);
  border-color: #bce8d2;
  border-left-color: #18a866;
  color: #115e3c;
}

.callout-title {
  font-weight: 650;
  margin-bottom: 4px;
}

.callout code {
  background: rgba(255, 255, 255, 0.65);
}

/* ===== Notes List ===== */
.notes-list {
  list-style: none;
  padding: 4px 0;
  margin-bottom: 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notes-list li {
  padding: 12px 18px 12px 38px;
  position: relative;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.notes-list li:last-child {
  border-bottom: none;
}

.notes-list li::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 19px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

/* ===== Status Code Badges ===== */
.status-code {
  display: inline-block;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 2px 9px;
  border-radius: 999px;
}

.status-2xx {
  background: var(--success-bg);
  color: var(--success);
}

.status-4xx {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-5xx {
  background: var(--error-bg);
  color: var(--error);
}

/* ===== Footer ===== */
.footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

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

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

  .menu-toggle {
    display: block;
  }

  .main {
    margin-left: 0;
    padding: 32px 22px 64px;
  }

  .header-version {
    display: none;
  }
}

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

  h2 {
    font-size: 19px;
  }

  .endpoint-method-path {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .header-subtitle {
    display: none;
  }

  .endpoint-cards {
    grid-template-columns: 1fr;
  }
}
