/* Status-specific overlays on Develop CIP chrome (developer-account.css). */

:root {
  --status-up: #34c759;
  --status-down: #ff3b30;
  --status-warn: #ff9f0a;
  --status-unknown: #8e8e93;
}

.dev-sidebar-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--hairline, #d2d2d7);
}

.dev-sidebar-subheading {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary, #86868b);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-banner {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.status-banner h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
}

.status-banner.is-operational h1 { color: var(--status-up); }
.status-banner.is-degraded h1,
.status-banner.is-partial_outage h1,
.status-banner.is-maintenance h1 { color: var(--status-warn); }
.status-banner.is-major_outage h1 { color: var(--status-down); }

.site-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.site-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline, #d2d2d7);
  text-decoration: none;
  color: inherit;
}

.site-row:hover .site-name { color: #0066cc; }

.site-name {
  font-size: 17px;
  font-weight: 400;
}

.comp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary, #6e6e73);
}

.comp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-unknown);
}
.comp-dot.is-operational { background: var(--status-up); }
.comp-dot.is-degraded,
.comp-dot.is-partial_outage,
.comp-dot.is-maintenance { background: var(--status-warn); }
.comp-dot.is-major_outage { background: var(--status-down); }

.site-open {
  font-size: 14px;
  color: #0066cc;
}

.incident-card,
.maint-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline, #d2d2d7);
}

.incident-update {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--hairline, #d2d2d7);
}

.incident-update-body {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.47;
  white-space: pre-wrap;
}

.incident-card h3,
.maint-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
}

.incident-meta,
.maint-meta {
  font-size: 13px;
  color: var(--text-secondary, #6e6e73);
  margin: 0 0 8px;
}

.maint-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.47;
  white-space: pre-wrap;
}

.subscribe-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.subscribe-box input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid var(--hairline, #d2d2d7);
  border-radius: 8px;
  font: inherit;
}

.subscribe-box button {
  padding: 10px 18px;
  border: 0;
  border-radius: 980px;
  background: #0071e3;
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: #0066cc;
  text-decoration: none;
  font-size: 14px;
}

.topo-wrap { margin-top: 8px; }

.topo-svg-wrap {
  position: relative;
  margin-top: 12px;
}

.topo-svg {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
}

.topo-node circle {
  fill: #f5f5f7;
  stroke: #1d1d1f;
  stroke-width: 1.5;
}

.topo-node text {
  font-size: 11px;
  text-anchor: middle;
  fill: #1d1d1f;
}

.topo-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.topo-flow-arrows {
  pointer-events: none;
}

.topo-flow-arrow {
  fill: var(--status-up);
}

.topo-edge:not(.is-up) .topo-flow-arrows {
  display: none;
}

.topo-edge.is-up .topo-line {
  stroke: var(--status-up);
  stroke-dasharray: 8 12;
  animation: topo-flow 1.6s linear infinite;
  will-change: stroke-dashoffset;
}

.topo-edge.is-down .topo-line {
  stroke: var(--status-down);
}

.topo-edge.is-loading .topo-line {
  stroke: var(--status-unknown);
  stroke-dasharray: 4 6;
  animation: topo-pulse 1s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .topo-edge.is-up .topo-line,
  .topo-edge.is-loading .topo-line {
    animation: none;
  }
  .topo-flow-arrows {
    display: none;
  }
}

.topo-latency {
  font-size: 11px;
  text-anchor: middle;
  fill: #6e6e73;
}

.topo-cross line {
  stroke: var(--status-down);
  stroke-width: 2;
}

.topo-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #f5f5f7;
  font-size: 12px;
  pointer-events: none;
}

@keyframes topo-flow {
  to { stroke-dashoffset: -20; }
}

@keyframes topo-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (prefers-color-scheme: dark) {
  .topo-node circle {
    fill: #1d1d1f;
    stroke: #f5f5f7;
  }
  .topo-node text { fill: #f5f5f7; }
  .status-banner h1 { color: inherit; }
  .status-banner.is-operational h1 { color: var(--status-up); }
}

.history-bar {
  margin: 0 0 28px;
}

.history-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.history-bar-head .dev-section-title {
  margin: 0;
}

.history-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary, #6e6e73);
}

.history-bar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.history-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--status-up);
}
.history-swatch.is-minor { background: var(--status-warn); }
.history-swatch.is-major { background: var(--status-down); }

.history-bar-track {
  position: relative;
  padding-bottom: 22px;
}

.history-bar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.history-day {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  cursor: default;
  position: relative;
}

.history-day-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--status-up);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.history-day.is-minor .history-day-fill { background: var(--status-warn); }
.history-day.is-major .history-day-fill { background: var(--status-down); }

.history-day:hover .history-day-fill,
.history-day:focus-visible .history-day-fill {
  transform: scaleY(1.12);
  opacity: 0.9;
}

.history-day:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.history-bar-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary, #86868b);
  pointer-events: none;
}

.history-bar-loading {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #6e6e73);
}

@media (max-width: 734px) {
  .site-row {
    grid-template-columns: 1fr auto;
  }
  .site-open { display: none; }
  .history-bar-days {
    gap: 3px;
  }
  .history-day {
    height: 22px;
  }
}
