/* Junior Arc — status page. Dark theme, no framework. */

:root {
  --bg: #0b0d10;
  --bg-elev: #14171c;
  --bg-elev-2: #1a1e25;
  --fg: #e7e9ee;
  --fg-muted: #8a93a0;
  --border: #232831;
  --ok: #10b981;
  --warn: #f59e0b;
  --down: #ef4444;
  --unknown: #6b7280;
  --accent: #6366f1;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
    Cantarell, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}

header {
  margin-bottom: 32px;
}

header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--fg-muted);
  margin: 4px 0 0;
  font-size: 14px;
}

/* ─── Overall status pill ───────────────────────────────────────────── */
.overall {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  transition: border-color 220ms ease;
}

.overall.ok { border-color: rgba(16, 185, 129, 0.35); }
.overall.warn { border-color: rgba(245, 158, 11, 0.35); }
.overall.down { border-color: rgba(239, 68, 68, 0.35); }

.dot {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--unknown);
  box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.15);
  transition: background 220ms ease, box-shadow 220ms ease;
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  animation: pulse 2.4s ease-in-out infinite;
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.dot.down {
  background: var(--down);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.08); }
}

.overall-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overall-status {
  font-size: 18px;
  font-weight: 500;
}

.overall-sub {
  font-size: 13px;
  margin: 0;
}

/* ─── Per-service rows ──────────────────────────────────────────────── */
.services {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.service {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.service-name {
  font-weight: 500;
}

.service-meta {
  grid-column: 1;
  font-size: 12px;
  margin: 0;
}

.service-status {
  grid-row: 1 / span 2;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  color: var(--fg-muted);
  font-weight: 500;
  white-space: nowrap;
}

.service-status.ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--ok);
}
.service-status.warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
}
.service-status.down {
  background: rgba(239, 68, 68, 0.14);
  color: var(--down);
}

/* ─── Metrics row ───────────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}

.metric {
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-label {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

/* ─── Recent probes ─────────────────────────────────────────────────── */
.recent {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 24px;
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.recent-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#refresh {
  appearance: none;
  background: var(--bg-elev-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

#refresh:hover { background: #222831; }
#refresh:active { transform: translateY(1px); }
#refresh:disabled { opacity: 0.5; cursor: wait; }

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.history li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.history li:last-child { border-bottom: none; }

.history .h-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--unknown);
}
.history .h-dot.ok { background: var(--ok); }
.history .h-dot.warn { background: var(--warn); }
.history .h-dot.down { background: var(--down); }

.history .h-when { color: var(--fg-muted); }
.history .h-latency { color: var(--fg-muted); }

footer {
  margin-top: 32px;
}

footer .muted {
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 480px) {
  .container { padding: 32px 16px 40px; }
  .metrics { grid-template-columns: 1fr; }
}
