/* Palette matches mcc-front's own "Mission Control" dark theme exactly
   (packages/ui/src/styles/globals.css) rather than a generic dark mode -
   brand consistency with the internal ops product this status page sits
   next to. */
:root {
  --primary: #00416E;
  --secondary: #37AFB9;
  --accent: #8C2DF5;
  --bg: #f0f4f8;
  --bg-subtle: #e2e8f0;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #52667a;
  --text-faint: #8195a8;
  --border: #dbe3ec;
  --up: #16a34a;
  --up-bg: #ecfdf3;
  --degraded: #d97706;
  --degraded-bg: #fffaeb;
  --down: #dc2626;
  --down-bg: #fef3f2;
  --unknown: #94a3b8;
  --unknown-bg: #f4f6f8;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 6px rgba(15, 23, 42, 0.05);
  --radius: 12px;
  --mono: "SF Mono", "Roboto Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #0074A9;
    --secondary: #37AFB9;
    --accent: #8C2DF5;
    --bg: #0b1622;
    --bg-subtle: #192d44;
    --card-bg: #162538;
    --text: #e2eaf4;
    --text-muted: #8faabf;
    --text-faint: #62839c;
    --border: rgba(148, 163, 184, 0.14);
    --up-bg: rgba(22, 163, 74, 0.14);
    --degraded-bg: rgba(217, 119, 6, 0.16);
    --down-bg: rgba(220, 38, 38, 0.16);
    --unknown-bg: rgba(148, 163, 184, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 20px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Subtle radial glow behind the top of the page - reads as "mission
     control" without needing a full starfield background image. */
  background-image: radial-gradient(ellipse 1200px 500px at 50% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent);
  background-repeat: no-repeat;
}

.page { max-width: 960px; margin: 0 auto; padding: 40px 24px 64px; }

header.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.brand-identity { display: flex; align-items: center; gap: 14px; }
header.brand img { width: 34px; height: 34px; flex-shrink: 0; }
.eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 4px;
}
header.brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
header.brand p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.85rem; }

.clock {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--secondary);
  white-space: nowrap;
  padding-top: 2px;
}
.clock .date-label { display: block; color: var(--text-faint); font-family: inherit; letter-spacing: 0.04em; margin-top: 2px; }

/* Overall status - compact pill, mirrors mcc-front's "All Systems Normal"
   badge rather than a big banner. */
.overview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 32px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.overview.up { background: var(--up-bg); color: var(--up); border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.overview.degraded { background: var(--degraded-bg); color: var(--degraded); border-color: color-mix(in srgb, var(--degraded) 30%, transparent); }
.overview.down { background: var(--down-bg); color: var(--down); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
.overview.unknown { background: var(--unknown-bg); color: var(--text-muted); border-color: var(--border); }
.overview .icon { width: 16px; height: 16px; flex-shrink: 0; }

.station { margin-bottom: 40px; }

.station-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.station-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.station-icon svg { width: 18px; height: 18px; color: var(--primary); }
.station-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.station-header .location {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--mono);
  margin-left: auto;
  white-space: nowrap;
}

.monitor {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.monitor-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.monitor-name-row { display: flex; align-items: center; gap: 10px; min-width: 0; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.up { background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.dot.degraded { background: var(--degraded); box-shadow: 0 0 0 3px var(--degraded-bg); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px var(--down-bg); }
.dot.unknown { background: var(--unknown); box-shadow: 0 0 0 3px var(--unknown-bg); }

.monitor-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monitor-status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.monitor-status.up { color: var(--up); background: var(--up-bg); }
.monitor-status.degraded { color: var(--degraded); background: var(--degraded-bg); }
.monitor-status.down { color: var(--down); background: var(--down-bg); }
.monitor-status.unknown { color: var(--text-muted); background: var(--unknown-bg); }

.meta {
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}
.monitor-desc { font-size: 0.82rem; color: var(--text-muted); margin: 8px 0 12px; line-height: 1.4; }

.bars { display: flex; gap: 2px; height: 26px; }
.bar { flex: 1; border-radius: 2px; background: var(--unknown-bg); }
.bar.up { background: var(--up); }
.bar.degraded { background: var(--degraded); }
.bar.down { background: var(--down); }

/* Antenna dishes - DSN-Now-style visual: icon per antenna, animated pulse
   rings while in an active contact, grouped in a grid per station. */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.dish-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Faint top glow on the card itself, echoing the page-level one */
.dish-card::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 80px;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%);
  pointer-events: none;
}

.dish-visual {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.dish-icon { width: 58px; height: 58px; position: relative; z-index: 1; filter: drop-shadow(0 0 6px transparent); }
.dish-icon.status-up { color: var(--up); }
.dish-icon.status-degraded { color: var(--degraded); }
.dish-icon.status-down { color: var(--down); }
.dish-icon.status-unknown { color: var(--unknown); opacity: 0.5; }

.dish-pulse {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: dish-pulse-ring 2.4s ease-out infinite;
  opacity: 0;
}
.dish-pulse:nth-child(2) { animation-delay: 0.8s; }
.dish-pulse:nth-child(3) { animation-delay: 1.6s; }

@keyframes dish-pulse-ring {
  0% { transform: scale(0.5); opacity: 0.55; }
  100% { transform: scale(2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dish-pulse { animation: none; display: none; }
}

.dish-name {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.dish-card .monitor-status { margin-bottom: 10px; }

.dish-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0 0 10px;
  min-height: 2.6em;
}

.dish-contact {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.dish-contact.idle { color: var(--text-faint); font-weight: 500; background: none; }
.dish-contact.upcoming { color: var(--text-muted); background: var(--bg-subtle); font-weight: 500; }
.dish-contact.live {
  color: var(--accent);
  background: var(--bg-subtle);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-blink 1.4s ease-in-out infinite;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.band-tag {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--secondary);
  font-family: var(--mono);
}

.mock-badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px dashed var(--degraded);
  color: var(--degraded);
  cursor: help;
}

footer.page-footer {
  max-width: 960px;
  margin: 32px auto 0;
  padding: 0 24px;
  color: var(--text-faint);
  font-size: 0.76rem;
  text-align: center;
  line-height: 1.5;
}

.error-banner {
  background: var(--down-bg);
  color: var(--down);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.skeleton {
  color: var(--text-faint);
  font-size: 0.9rem;
  padding: 8px 0;
}
