/*
 * Orkyo status page — self-contained stylesheet
 * ------------------------------------------------------------------------
 * Deliberately standalone: this page lives in orkyo-infra and is served by
 * the nginx stack, so it must not depend on the orkyo-saas frontend image
 * (/site.css). The reset / body / container / footer blocks below are kept
 * visually in sync with orkyo-saas frontend/marketing/site.css by hand —
 * same palette, same breakpoints. Keep any edit purely cosmetic.
 *
 * The marketing header/nav is intentionally NOT carried over — see the
 * comment in index.html.
 *
 * Breakpoints (mirrors site.css):
 *   phone   : @media (max-width: 767px)
 *   tablet  : @media (max-width: 1023px)
 *   desktop : default (>= 1024px)
 * ------------------------------------------------------------------------
 */

/* ── Reset ─────────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Body base ─────────────────────────────────────────────────────────── */
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #020817;
  background: #fff;
}

/* ── Layout container ──────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ── Footer ────────────────────────────────────────────────────────────── */
footer { background: #0f172a; color: white; padding: 2rem 0; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem; flex-wrap: wrap; }
.footer-links a { color: rgba(255, 255, 255, 0.7); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: white; }
footer p { opacity: 0.7; font-size: 0.9rem; }

/* ── Page shell ────────────────────────────────────────────────────────── */
/* No header bar, so the title needs its own breathing room from the top. */
main { padding: 3.5rem 0 4rem; }
.page-title { font-size: 1.75rem; margin-bottom: 0.25rem; }
.page-subtitle { color: #64748b; font-size: 0.95rem; margin-bottom: 2rem; }

/* ── State colour tokens ───────────────────────────────────────────────── */
/* Mirrors the operational / degraded / down triad already used across the
   marketing pages (green #38a169, amber #78350f on #fef5e7, red #e53e3e). */
:root {
  --op-fg:      #276749;
  --op-bg:      #f0fff4;
  --op-border:  #c6f6d5;
  --op-bar:     #38a169;

  --deg-fg:     #78350f;
  --deg-bg:     #fef5e7;
  --deg-border: #fbd89d;
  --deg-bar:    #d69e2e;

  --out-fg:     #9b2c2c;
  --out-bg:     #fff5f5;
  --out-border: #fed7d7;
  --out-bar:    #e53e3e;

  --unk-fg:     #475569;
  --unk-bg:     #f1f5f9;
  --unk-border: #e2e8f0;
  --unk-bar:    #cbd5e1;
}

/* ── Overall status banner ─────────────────────────────────────────────── */
.overall {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--unk-border);
  border-radius: 16px;
  background: var(--unk-bg);
  color: var(--unk-fg);
  font-size: 1.15rem;
  font-weight: 600;
}
.overall .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--unk-bar); flex: 0 0 auto; }
.overall.is-operational { background: var(--op-bg);  border-color: var(--op-border);  color: var(--op-fg); }
.overall.is-operational .dot { background: var(--op-bar); }
.overall.is-degraded    { background: var(--deg-bg); border-color: var(--deg-border); color: var(--deg-fg); }
.overall.is-degraded .dot { background: var(--deg-bar); }
.overall.is-outage      { background: var(--out-bg); border-color: var(--out-border); color: var(--out-fg); }
.overall.is-outage .dot { background: var(--out-bar); }

.generated {
  margin-top: 0.6rem;
  color: #64748b;
  font-size: 0.85rem;
}

/* ── Section headings ──────────────────────────────────────────────────── */
h2 { font-size: 1.15rem; margin: 2.5rem 0 1rem; }

/* ── Component list ────────────────────────────────────────────────────── */
.components {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
}
.component { padding: 1.25rem 1.5rem; border-top: 1px solid #e2e8f0; }
.component:first-child { border-top: none; }
.component-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.component-name { font-weight: 600; }
.component-state { font-size: 0.85rem; font-weight: 600; }
.component-state.is-operational { color: var(--op-fg); }
.component-state.is-degraded    { color: var(--deg-fg); }
.component-state.is-outage      { color: var(--out-fg); }
.component-state.is-unknown     { color: var(--unk-fg); }

/* 90-day uptime bars */
.bars {
  display: flex;
  gap: 2px;
  margin-top: 0.85rem;
  height: 30px;
}
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--unk-bar); }
.bar.is-up      { background: var(--op-bar); }
.bar.is-partial { background: var(--deg-bar); }
.bar.is-down    { background: var(--out-bar); }
.bar.is-nodata  { background: #e2e8f0; }

.bars-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  color: #64748b;
  font-size: 0.8rem;
}
.range-trimmed { display: none; }

/* ── Incidents ─────────────────────────────────────────────────────────── */
.incident-day { padding-top: 1rem; border-top: 1px solid #e2e8f0; margin-top: 1rem; }
.incident-day:first-child { padding-top: 0; border-top: none; margin-top: 0; }
.incident-date { font-weight: 600; }
.incident-none { color: #64748b; font-size: 0.9rem; }
/* Quiet days stay compact so a long incident-free stretch doesn't dominate. */
.incident-day.is-quiet { padding-top: 0.6rem; margin-top: 0.6rem; }
.incident-day:not(.is-quiet) .incident-date { margin-bottom: 0.5rem; }

.incident { margin-bottom: 1.25rem; }
.incident:last-child { margin-bottom: 0; }
.incident-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.badge {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--unk-border);
  background: var(--unk-bg);
  color: var(--unk-fg);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge.is-resolved    { border-color: var(--op-border);  background: var(--op-bg);  color: var(--op-fg); }
.badge.is-maintenance { border-color: var(--deg-border); background: var(--deg-bg); color: var(--deg-fg); }
.badge.is-open        { border-color: var(--out-border); background: var(--out-bg); color: var(--out-fg); }

.incident-updates { list-style: none; }
.incident-update { padding: 0.35rem 0 0.35rem 0.9rem; border-left: 2px solid #e2e8f0; }
.incident-update .update-status { font-weight: 600; text-transform: capitalize; }
.incident-update .update-time { color: #64748b; font-size: 0.8rem; }

/* ── Phone ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .container { padding: 0 1rem; }
  main { padding: 2.5rem 0 3rem; }
  .footer-links { gap: 1rem; }
  .overall { font-size: 1rem; padding: 1rem 1.15rem; }
  .component { padding: 1rem 1.15rem; }
  .bars { height: 24px; gap: 1px; }
  /* 90 bars are unreadable on a phone — the last 30 days are enough. */
  .bar.is-trimmed { display: none; }
  .range-full { display: none; }
  .range-trimmed { display: inline; }
}
