@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --blue-deep: #1a5cff;
  --blue-mid: #2e7cf6;
  --blue-light: #4da3ff;
  --green-bright: #00e88f;
  --green-mid: #2dd4a0;
  --cyan: #00d4c8;
  --bg: #0a1628;
  --bg-card: rgba(16, 32, 64, 0.6);
  --border: rgba(45, 130, 255, 0.15);
  --border-hover: rgba(45, 130, 255, 0.3);
  --text-primary: #e8f0ff;
  --text-secondary: #8aa4cc;
  --text-muted: #4a6590;
  --bar-ok: #00e88f;
  --bar-degraded: #ffc44d;
  --bar-partial: #ff8c42;
  --bar-major: #ff4d6a;
  --bar-none: rgba(45, 130, 255, 0.1);
  --yellow: #ffc44d;
  --orange: #ff8c42;
  --red: #ff4d6a;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── Background ── */
.bg-art {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-circle {
  position: absolute;
  border-radius: 50%;
}
.bg-circle-1 {
  width: 900px;
  height: 900px;
  top: -200px;
  right: -200px;
  background: radial-gradient(circle, var(--green-bright), transparent 70%);
  opacity: 0.06;
  animation: drift 20s ease-in-out infinite;
}
.bg-circle-2 {
  width: 700px;
  height: 700px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, var(--blue-mid), transparent 70%);
  opacity: 0.06;
  animation: drift 25s ease-in-out infinite reverse;
}
.bg-circle-3 {
  width: 500px;
  height: 500px;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--cyan), transparent 70%);
  opacity: 0.05;
  animation: drift 18s ease-in-out infinite;
}
.bg-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 232, 143, 0.04);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.bg-ring-1 {
  width: 600px;
  height: 600px;
}
.bg-ring-2 {
  width: 900px;
  height: 900px;
}
.bg-ring-3 {
  width: 1200px;
  height: 1200px;
}
@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 15px) scale(0.97);
  }
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.header {
  padding: 36px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  width: 44px;
  height: 44px;
}
.logo svg {
  width: 100%;
  height: 100%;
}
.header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.header h1 span {
  background: linear-gradient(135deg, var(--green-bright), var(--blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Global banner ── */
.global-banner {
  margin: 0 0 32px;
  padding: 22px 28px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  font-weight: 600;
  backdrop-filter: blur(20px);
  border: 1px solid;
  position: relative;
  overflow: hidden;
}
.global-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background: linear-gradient(135deg, var(--green-bright), var(--blue-mid));
  pointer-events: none;
}
.global-banner.operational {
  border-color: rgba(0, 232, 143, 0.2);
  color: var(--green-bright);
}
.global-banner.degraded {
  border-color: rgba(255, 196, 77, 0.2);
  color: var(--yellow);
}
.global-banner.partial {
  border-color: rgba(255, 140, 66, 0.2);
  color: var(--orange);
}
.global-banner.major {
  border-color: rgba(255, 77, 106, 0.2);
  color: var(--red);
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  animation: pulsing 2s ease-in-out infinite;
}
.pulse-dot.operational {
  background: var(--green-bright);
}
.pulse-dot.operational::after {
  border: 2px solid var(--green-bright);
}
.pulse-dot.degraded {
  background: var(--yellow);
}
.pulse-dot.degraded::after {
  border: 2px solid var(--yellow);
}
.pulse-dot.partial {
  background: var(--orange);
}
.pulse-dot.partial::after {
  border: 2px solid var(--orange);
}
.pulse-dot.major {
  background: var(--red);
}
.pulse-dot.major::after {
  border: 2px solid var(--red);
}
@keyframes pulsing {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(1.8);
  }
}

/* ── Service groups ── */
.service-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: visible;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}
.service-group:hover {
  border-color: var(--border-hover);
}
.group-header {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  border-radius: var(--radius);
}
.group-header:hover {
  background: rgba(26, 92, 255, 0.04);
}
.group-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.group-name {
  font-weight: 600;
  font-size: 15px;
}
.badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.badge.operational {
  background: rgba(0, 232, 143, 0.12);
  color: var(--green-bright);
}
.badge.degraded {
  background: rgba(255, 196, 77, 0.12);
  color: var(--yellow);
}
.badge.partial {
  background: rgba(255, 140, 66, 0.12);
  color: var(--orange);
}
.badge.major {
  background: rgba(255, 77, 106, 0.12);
  color: var(--red);
}
.chevron {
  color: var(--text-muted);
  transition: transform 0.25s;
  font-size: 16px;
}
.service-group.open .chevron {
  transform: rotate(180deg);
}
.group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.service-group.open .group-body {
  max-height: 1400px;
  overflow: visible;
}

/* ── Service row ── */
.svc-row {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 20px;
  transition: background 0.1s;
  position: relative;
  z-index: 1;
}
.svc-row:hover {
  background: rgba(26, 92, 255, 0.03);
  z-index: 10;
}
.svc-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.svc-name {
  font-size: 14px;
  font-weight: 500;
}
.svc-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.operational {
  background: var(--green-bright);
  box-shadow: 0 0 6px rgba(0, 232, 143, 0.4);
}
.dot.degraded {
  background: var(--yellow);
  box-shadow: 0 0 6px rgba(255, 196, 77, 0.4);
}
.dot.partial {
  background: var(--orange);
  box-shadow: 0 0 6px rgba(255, 140, 66, 0.4);
}
.dot.major {
  background: var(--red);
  box-shadow: 0 0 6px rgba(255, 77, 106, 0.4);
}
.dot.none {
  background: var(--text-muted);
}

/* ── Timeline bars — FIXED ── */
.timeline-wrap {
  position: relative;
  overflow: visible;
}

.timeline {
  display: flex;
  gap: 3px;
  height: 32px;
  align-items: stretch;
}

.day-bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 3px;
  cursor: pointer;
  transition:
    transform 0.12s,
    filter 0.12s;
  position: relative;
}
.day-bar:hover {
  transform: scaleY(1.25) scaleX(1.4);
  filter: brightness(1.2);
  z-index: 50;
}
.day-bar.operational {
  background: var(--bar-ok);
}
.day-bar.degraded {
  background: var(--bar-degraded);
}
.day-bar.partial {
  background: var(--bar-partial);
}
.day-bar.major {
  background: var(--bar-major);
}
.day-bar.none {
  background: var(--bar-none);
}

/* ── Tooltip — global positioned ── */
#globalTip {
  position: fixed;
  display: none;
  background: rgba(8, 16, 32, 0.96);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  line-height: 1.6;
}
#globalTip .t-date {
  color: var(--text-secondary);
  font-size: 11px;
}
#globalTip .t-val {
  font-weight: 700;
  font-size: 14px;
}
#globalTip .t-status {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.tl-labels {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 6px 22px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.tl-labels-inner {
  display: flex;
  justify-content: space-between;
}

/* ── Incidents ── */
.incidents {
  margin: 40px 0 48px;
}
.incidents h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}
.inc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  margin-bottom: 10px;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}
.inc-card:hover {
  border-color: var(--border-hover);
}
.inc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.inc-title {
  font-weight: 600;
  font-size: 14px;
}
.inc-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.inc-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.inc-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 12px;
  font-weight: 600;
}
.inc-tag.resolved {
  background: rgba(0, 232, 143, 0.12);
  color: var(--green-bright);
}
.inc-tag.monitoring {
  background: rgba(77, 163, 255, 0.12);
  color: var(--blue-light);
}
.inc-tag.investigating {
  background: rgba(255, 196, 77, 0.12);
  color: var(--yellow);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}
.footer a {
  color: var(--green-bright);
  text-decoration: none;
}

@media (max-width: 900px) {
  .svc-row {
    grid-template-columns: 180px 1fr;
    gap: 14px;
  }
  .tl-labels {
    grid-template-columns: 180px 1fr;
    gap: 14px;
  }
}
@media (max-width: 768px) {
  .svc-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }
  .tl-labels {
    grid-template-columns: 1fr;
    padding: 6px 16px 14px;
  }
  .tl-labels-spacer {
    display: none;
  }
  .header h1 {
    font-size: 17px;
  }
  .timeline {
    height: 24px;
  }
}
