/* ══════════════════════════════════════════════════════════════════
   VIUCraft System Status — standalone status page
   Extracted from inline <style>; redesigned with the site's blue → cyan
   system. Calm when green, urgent (not alarming) when degraded/down.
   Dark mode via [data-theme="dark"]. Responsive 375px → 1440px+.
   Status-state classes injected by Twig are styled exactly:
     .status-banner--ok/--degraded/--down, .status-dot--ok/--degraded/--down
   ══════════════════════════════════════════════════════════════════ */

:root {
  --st-bg: #f6f8fb;
  --st-surface: #ffffff;
  --st-surface-2: #f9fafb;
  --st-border: rgba(15, 23, 42, 0.08);
  --st-text: #0f172a;
  --st-text-muted: #64748b;
  --st-text-faint: #94a3b8;

  --st-ok: #10b981;
  --st-ok-bg: rgba(16, 185, 129, 0.12);
  --st-ok-text: #0f8a5f;
  --st-degraded: #f59e0b;
  --st-degraded-bg: rgba(245, 158, 11, 0.14);
  --st-degraded-text: #b45309;
  --st-down: #ef4444;
  --st-down-bg: rgba(239, 68, 68, 0.12);
  --st-down-text: #b91c1c;
}

[data-theme="dark"] {
  --st-bg: #07070e;
  --st-surface: #0e0e1a;
  --st-surface-2: #14141f;
  --st-border: rgba(255, 255, 255, 0.08);
  --st-text: #f1f5f9;
  --st-text-muted: #94a3b8;
  --st-text-faint: #64748b;
  --st-ok-text: #34d399;
  --st-degraded-text: #fbbf24;
  --st-down-text: #f87171;
}

/* ════════════════════════ WRAPPER ════════════════════════ */
.status-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(6rem, 10vw, 7.5rem) 1rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(110% 80% at 50% -10%, rgba(14, 165, 233, 0.08), transparent 55%),
    var(--st-bg);
  position: relative;
  overflow: hidden;
}
.status-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 25%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 25%, transparent 70%);
  pointer-events: none;
}
[data-theme="dark"] .status-wrapper {
  background:
    radial-gradient(110% 80% at 50% -10%, rgba(37, 99, 235, 0.22), transparent 55%),
    var(--st-bg);
}
[data-theme="dark"] .status-wrapper::before { background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px); }

/* ════════════════════════ CARD ════════════════════════ */
.status-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 20px 48px -24px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}
[data-theme="dark"] .status-card { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -28px rgba(0, 0, 0, 0.8); }

.status-card__head {
  padding: 2.25rem 2rem 1.75rem;
  border-bottom: 1px solid var(--st-border);
  text-align: center;
}

.status-logo {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-md, 10px);
  background: var(--vc-grad-brand);
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 10px 24px -8px rgba(14, 165, 233, 0.6);
}

.status-card__head h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--st-text);
}

/* ── Overall banner ── */
.status-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full, 9999px);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 600;
  border: 1px solid transparent;
}
.status-banner i { font-size: 0.95em; }

.status-banner--ok {
  background: var(--st-ok-bg);
  color: var(--st-ok-text);
  border-color: rgba(16, 185, 129, 0.25);
}
.status-banner--degraded {
  background: var(--st-degraded-bg);
  color: var(--st-degraded-text);
  border-color: rgba(245, 158, 11, 0.3);
}
.status-banner--down {
  background: var(--st-down-bg);
  color: var(--st-down-text);
  border-color: rgba(239, 68, 68, 0.3);
}

/* animated pulse dot prepended to non-ok banners */
.status-banner--degraded::before,
.status-banner--down::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-banner--degraded::before { background: var(--st-degraded); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); animation: status-pulse-amber 1.8s infinite; }
.status-banner--down::before { background: var(--st-down); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); animation: status-pulse-red 1.8s infinite; }

@keyframes status-pulse-amber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes status-pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ════════════════════════ BODY ════════════════════════ */
.status-card__body { padding: 1.5rem 2rem 1.75rem; }

.status-card__body > div:first-child {
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--st-text-faint) !important;
  margin-bottom: 0.5rem;
}

.status-component {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0.75rem;
  margin: 0 -0.75rem;
  border-radius: var(--radius-md, 10px);
  border-bottom: 1px solid var(--st-border);
  transition: background var(--transition-base, 0.2s ease);
}
.status-component:hover { background: var(--st-surface-2); }
.status-component:last-child { border-bottom: none; }

.status-component__name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--st-text);
  display: flex;
  align-items: center;
}
.status-component__name i {
  width: 1.5rem;
  color: var(--st-text-faint) !important;
  font-size: 0.95rem;
}
.status-component__latency {
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--st-text-faint);
  margin-top: 0.2rem;
  margin-left: 1.5rem;
  font-family: var(--font-family-mono);
}

/* ── Status dot/label per component ── */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full, 9999px);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  white-space: nowrap;
}
.status-dot::before {
  content: "";
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}
.status-dot--ok { color: var(--st-ok-text); background: var(--st-ok-bg); }
.status-dot--ok::before { background: var(--st-ok); }
.status-dot--degraded { color: var(--st-degraded-text); background: var(--st-degraded-bg); }
.status-dot--degraded::before { background: var(--st-degraded); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); animation: status-pulse-amber 1.8s infinite; }
.status-dot--down { color: var(--st-down-text); background: var(--st-down-bg); }
.status-dot--down::before { background: var(--st-down); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); animation: status-pulse-red 1.8s infinite; }

/* ════════════════════════ FOOTER ════════════════════════ */
.status-card__foot {
  padding: 1rem 2rem;
  background: var(--st-surface-2);
  border-top: 1px solid var(--st-border);
  text-align: center;
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--st-text-faint);
}
.status-card__foot::before {
  content: "\f017";
  font-family: "Font Awesome 6 Free";
  font-weight: 400;
  margin-right: 0.4rem;
  opacity: 0.7;
}

/* ════════════════════════ RESPONSIVE ════════════════════════ */
@media (max-width: 480px) {
  .status-card__head { padding: 2rem 1.25rem 1.5rem; }
  .status-card__body { padding: 1.25rem 1.25rem 1.5rem; }
  .status-card__foot { padding: 1rem 1.25rem; }
  .status-component { padding-left: 0.5rem; padding-right: 0.5rem; margin: 0 -0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .status-banner--degraded::before, .status-banner--down::before,
  .status-dot--degraded::before, .status-dot--down::before { animation: none; }
}
