/* ============================================================
   Mumara Campaigns API — shared sticky header
   Used by v1/v2 Scalar (index.html) and Swagger (swagger.html).
   Defensively scoped so Scalar/Swagger globals can't bleed in.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

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

.api-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, #1c1334 0%, #221541 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.api-header a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Brand block ---------- */
.api-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  transition: opacity 0.15s ease;
}
.api-header__brand:hover { opacity: 0.85; }

.api-header__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.api-header__name {
  color: white;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.api-header__sep {
  color: rgba(255, 255, 255, 0.22);
  font-weight: 400;
  user-select: none;
}

.api-header__version {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
}

.api-header__status {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.api-header__status--rec { color: #6ee7b7; }
.api-header__status--legacy { color: rgba(255, 255, 255, 0.4); }

/* ---------- Nav ---------- */
.api-header__nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.api-header__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.api-header__link svg {
  width: 13px;
  height: 13px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.api-header__link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}
.api-header__link:hover svg { opacity: 1; }

.api-header__divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 6px;
  flex-shrink: 0;
}

/* Theme toggle (Scalar pages only — Swagger has no native dark mode) */
.api-header__theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
}
.api-header__theme-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}
.api-header__theme-toggle svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 15px;
  height: 15px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.api-header__theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-30deg) scale(0.85);
}
.api-header__theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
.api-header__theme-toggle[data-theme="dark"] .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
.api-header__theme-toggle[data-theme="dark"] .icon-moon {
  opacity: 0;
  transform: rotate(30deg) scale(0.85);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .api-header { padding: 11px 18px; gap: 18px; }
  .api-header__name { font-size: 13.5px; }
  .api-header__link { padding: 6px 10px; font-size: 12.5px; }
}
@media (max-width: 720px) {
  .api-header {
    padding: 10px 14px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .api-header__sep,
  .api-header__divider { display: none; }
  .api-header__nav { gap: 0; }
}
@media (max-width: 540px) {
  .api-header__name { display: none; }
}
