/* ============================================================
   Public Status Page — Pure CSS, no build step required
   ============================================================ */

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

:root {
  --green:  #22c55e;
  --red:    #ef4444;
  --yellow: #f59e0b;
  --gray:   #6b7280;
  --border: #e5e7eb;
  --bg:     #f9fafb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: #111827;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.hero.all-up   { background: #f0fdf4; border-color: #bbf7d0; }
.hero.degraded { background: #fef2f2; border-color: #fecaca; }
.hero.error    { background: #f9fafb; }

.hero-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.hero h1   { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.hero .status-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray);
}
.hero.all-up   .status-text { color: #166534; }
.hero.degraded .status-text { color: #991b1b; }
.hero .description { margin-top: 0.5rem; font-size: 0.9rem; color: var(--gray); }

/* ── Section ──────────────────────────────────────────────── */
.section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ── Service row ──────────────────────────────────────────── */
.service-row {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

/* Line 1: name on the left, uptime % + badge on the right */
.service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.service-row:last-child { border-bottom: none; }

.service-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-up      { background: var(--green); }
.dot-down    { background: var(--red); }
.dot-unknown { background: #9ca3af; }
.dot-paused  { background: var(--yellow); }

.service-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}
.service-url {
  display: block;
  font-size: 0.75rem;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.service-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* ── Uptime bars ──────────────────────────────────────────── */
/* Line 2: full-width graph — bars share the row evenly */
.uptime-bars {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 28px;
  width: 100%;
  margin-top: 0.625rem;
}
.uptime-bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  height: 100%;
  cursor: default;
  transition: opacity 0.15s;
}
.uptime-bar:hover { opacity: 0.75; }

.uptime-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.service-avail {
  font-size: 0.75rem;
  color: var(--gray);
  white-space: nowrap;
}

/* ── Badges ───────────────────────────────────────────────── */
.service-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-up      { background: #dcfce7; color: #166534; }
.badge-down    { background: #fee2e2; color: #991b1b; }
.badge-unknown { background: #f3f4f6; color: #6b7280; }
.badge-paused  { background: #fef9c3; color: #854d0e; }

/* ── Incidents ────────────────────────────────────────────── */
.incident {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border-left: 4px solid;
}
.incident-ongoing  { background: #fef2f2; border-color: var(--red); }
.incident-resolved { background: #f0fdf4; border-color: var(--green); }

.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.incident-status { font-size: 0.8rem; font-weight: 600; }
.incident-error  { font-size: 0.875rem; color: #374151; margin-bottom: 0.4rem; }
.incident-meta   { font-size: 0.75rem; color: var(--gray); }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: #9ca3af;
  border-top: 1px solid var(--border);
  background: #fff;
}

.empty { color: var(--gray); text-align: center; padding: 2rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .service-avail { display: none; }
  /* 30 bars in a narrow viewport: drop the gap so they stay visible */
  .uptime-bars   { gap: 1px; height: 24px; }
}
