/* ═══════════════════════════════════════════════════════════════════════════
   STATUS PAGE — BelugAPI
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero banner ──────────────────────────────────────────────────────────── */

.status-banner {
  padding-top: 64px; /* nav height */
  position: relative;
  overflow: hidden;
}

.status-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .06;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, currentColor, transparent);
}

.status-banner.operational { color: var(--green); }
.status-banner.degraded    { color: var(--amber); }
.status-banner.outage      { color: var(--red); }

.status-banner-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 64px 24px 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

/* Eyebrow row */
.status-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.status-eyebrow-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.json-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent);
  border: 1px solid rgba(0,87,255,.2);
  border-radius: 100px;
  padding: 3px 10px;
  text-decoration: none;
  transition: background 0.15s;
}

.json-pill:hover { background: var(--accent-light); }

/* Main status display */
.status-main {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.status-ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.status-ring-wrap svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.status-ring-bg { opacity: .12; }

.status-ring-fill {
  transition: stroke-dashoffset 1s linear;
  stroke-linecap: round;
}

.status-ring-dot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  position: relative;
}

.status-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .25;
  animation: ripple 2s ease-out infinite;
}

@keyframes ripple {
  0%   { transform: scale(.7); opacity: .3; }
  100% { transform: scale(1.8); opacity: 0; }
}

.status-banner.operational .status-pulse { background: var(--green); color: var(--green); }
.status-banner.degraded    .status-pulse { background: var(--amber); color: var(--amber); }
.status-banner.outage      .status-pulse { background: var(--red);   color: var(--red); }

.status-ring-wrap svg .status-ring-bg   { stroke: currentColor; }
.status-ring-wrap svg .status-ring-fill { stroke: currentColor; }
.status-banner.operational .status-ring-wrap { color: var(--green); }
.status-banner.degraded    .status-ring-wrap { color: var(--amber); }
.status-banner.outage      .status-ring-wrap { color: var(--red); }

.status-text h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -1.2px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}

.status-text .meta {
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-sep { opacity: .35; }

.meta strong { color: var(--text-muted); font-weight: 500; }

/* Refresh button */
#refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

#refresh-btn:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface2);
}

#refresh-btn .spin-icon { transition: transform 0.6s ease; }
#refresh-btn.spinning .spin-icon { transform: rotate(360deg); }

/* ── Stats strip ──────────────────────────────────────────────────────────── */

.stats-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-strip-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  divide-x: 1px solid var(--border);
}

.stat-item {
  padding: 20px 32px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-item:last-child { border-right: none; }

.stat-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.stat-content {}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
  display: block;
  line-height: 1;
  margin-bottom: 3px;
}

.stat-value.ok   { color: var(--green); }
.stat-value.warn { color: var(--amber); }
.stat-value.err  { color: var(--red); }

.stat-label {
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Section wrapper ──────────────────────────────────────────────────────── */

.status-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-heading {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Services list ────────────────────────────────────────────────────────── */

.services-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.service-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 0;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
}

.service-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.service-row.ok::before     { background: var(--green); opacity: 1; }
.service-row.degraded::before { background: var(--amber); opacity: 1; }
.service-row.down::before   { background: var(--red); opacity: 1; }

.service-row:last-child { border-bottom: none; }

.service-row:hover { background: var(--surface2); }

/* Left: icon */
.sr-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-right: 16px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.service-row.ok     .sr-icon { background: var(--green-light); color: var(--green); }
.service-row.degraded .sr-icon { background: var(--amber-light); color: var(--amber); }
.service-row.down   .sr-icon { background: #fee2e2; color: var(--red); }

/* Center: info + uptime */
.sr-body {
  display: flex;
  align-items: center;
  gap: 32px;
  min-width: 0;
}

.sr-info { min-width: 160px; }

.sr-name {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.sr-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Uptime bars */
.sr-uptime {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.uptime-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.uptime-bars span {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  background: var(--green-light);
  transition: opacity 0.15s, background 0.15s;
  cursor: default;
}

.uptime-bars span.gap-bar  { background: #fca5a5; }
.uptime-bars span.warn-bar { background: #fde68a; }
.uptime-bars span:hover    { opacity: .65; }

.uptime-label {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: .03em;
  white-space: nowrap;
}

/* Right: latency + pill */
.sr-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 24px;
  flex-shrink: 0;
}

.sr-latency {
  text-align: right;
}

.latency-val {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.latency-val.lat-ok      { color: var(--green); }
.latency-val.lat-warn    { color: var(--amber); }
.latency-val.lat-err     { color: var(--red); }
.latency-val.lat-unknown { color: var(--text-faint); }

.latency-sub {
  font-size: 11px;
  color: var(--text-faint);
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill .pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-pill.ok       { background: var(--green-light); color: var(--green); }
.status-pill.degraded { background: var(--amber-light); color: var(--amber); }
.status-pill.down     { background: #fee2e2;             color: var(--red); }

/* ── Incidents placeholder ────────────────────────────────────────────────── */

.incidents-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.incidents-box .ib-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.incidents-box h3 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.incidents-box p {
  font-size: 13px;
  color: var(--text-faint);
}

/* ── CTA banner ───────────────────────────────────────────────────────────── */

.status-cta-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.status-cta-inner {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.status-cta-inner h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 5px;
}

.status-cta-inner p { font-size: 14px; opacity: .6; }

.status-cta-inner a {
  background: var(--bg);
  color: var(--text);
  padding: 12px 26px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.status-cta-inner a:hover { opacity: .85; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .sr-body { gap: 16px; }
  .sr-uptime { display: none; }
}

@media (max-width: 680px) {
  .stats-strip-inner { grid-template-columns: 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }

  .service-row {
    grid-template-columns: 36px 1fr auto;
    gap: 0;
    padding: 16px 16px 16px 20px;
  }

  .sr-body { gap: 0; }
  .sr-desc { display: none; }
  .sr-latency { display: none; }

  .status-cta-inner { flex-direction: column; text-align: center; padding: 32px 24px; }
}

@media (max-width: 480px) {
  .status-banner-inner { padding: 48px 20px 40px; }
  .status-text h1 { font-size: 24px; letter-spacing: -.8px; }
}

/* ── Entry animations ─────────────────────────────────────────────────────── */

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

.anim { animation: fade-up .4s ease both; }
.anim-d1 { animation-delay: .05s; }
.anim-d2 { animation-delay: .10s; }
.anim-d3 { animation-delay: .15s; }
.anim-d4 { animation-delay: .20s; }
.anim-d5 { animation-delay: .25s; }
