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

:root {
  --bg: #000;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-hover-border: rgba(255, 255, 255, 0.12);
  --text-primary: #fff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-tertiary: rgba(255, 255, 255, 0.25);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --gray: rgba(255, 255, 255, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background blobs ─────────────────────────────────────── */

.bg-effects {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: #1e40af;
  top: -200px;
  left: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: #7e22ce;
  top: 50%;
  right: -150px;
  animation-delay: -7s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: #0d9488;
  bottom: -100px;
  left: 30%;
  animation-delay: -14s;
}

@keyframes blobFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(20px, 10px) scale(1.02);
  }
}

/* ── Layout ───────────────────────────────────────────────── */

.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 20px 40px;
}

/* ── Header ───────────────────────────────────────────────── */

.header {
  text-align: center;
  margin-bottom: 48px;
}

.logo {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.status-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 100px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.5s ease;
}

.status-banner[data-status="operational"] {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.15);
  background: rgba(34, 197, 94, 0.05);
}

.status-banner[data-status="degraded"] {
  color: var(--yellow);
  border-color: rgba(234, 179, 8, 0.15);
  background: rgba(234, 179, 8, 0.05);
}

.status-banner[data-status="down"] {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.05);
}

.status-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-banner[data-status="operational"] .status-banner-dot {
  animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseGreen {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

/* ── Monitor cards (liquid glass) ─────────────────────────── */

.monitors {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.monitor-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.045) 0%,
    rgba(255, 255, 255, 0.015) 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.monitor-card:hover {
  border-color: var(--card-hover-border);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05),
    0 8px 32px -8px rgba(0, 0, 0, 0.3);
}

.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.monitor-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.monitor-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.monitor-status-dot.up {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.monitor-status-dot.down {
  background: var(--red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  animation: pulseDot 1.5s ease-in-out infinite;
}

.monitor-status-dot.paused {
  background: var(--text-tertiary);
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
  }
}

/* ── Stats row ────────────────────────────────────────────── */

.monitor-stats {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
}

.stat-label {
  color: var(--text-tertiary);
  font-weight: 500;
}

.stat-value {
  font-weight: 700;
  color: var(--text-secondary);
}

.stat-value.good {
  color: var(--green);
}
.stat-value.warn {
  color: var(--yellow);
}
.stat-value.bad {
  color: var(--red);
}

.stat-rt {
  margin-left: auto;
}

.stat-rt .stat-value {
  color: var(--text-secondary);
}

/* ── Uptime bars ──────────────────────────────────────────── */

.bars-container {
  position: relative;
  margin-bottom: 8px;
}

.bars {
  display: flex;
  gap: 1.5px;
  height: 32px;
}

.bar {
  flex: 1;
  min-width: 0;
  border-radius: 2px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
  transform-origin: bottom;
  animation: barEnter 0.4s ease-out backwards;
}

.bar:hover {
  transform: scaleY(1.3);
  filter: brightness(1.2);
  z-index: 1;
}

.bar.up {
  background: linear-gradient(to top, #16a34a, #22c55e);
}
.bar.degraded {
  background: linear-gradient(to top, #ca8a04, #eab308);
}
.bar.down {
  background: linear-gradient(to top, #dc2626, #ef4444);
}
.bar.unknown {
  background: var(--gray);
}

@keyframes barEnter {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.bars-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ── Tooltip ──────────────────────────────────────────────── */

.tooltip {
  position: fixed;
  z-index: 1000;
  padding: 8px 12px;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip-date {
  color: var(--text-secondary);
  font-size: 0.7rem;
  margin-bottom: 2px;
}

.tooltip-uptime {
  font-weight: 600;
}

.tooltip-uptime.good {
  color: var(--green);
}
.tooltip-uptime.warn {
  color: var(--yellow);
}
.tooltip-uptime.bad {
  color: var(--red);
}

/* ── Skeleton loading ─────────────────────────────────────── */

.skeleton-text {
  background: linear-gradient(
    90deg,
    var(--gray) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--gray) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-bars {
  height: 32px;
  background: linear-gradient(
    90deg,
    var(--gray) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--gray) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ── Footer ───────────────────────────────────────────────── */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.18));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.1rem;
}

/* ── Error state ──────────────────────────────────────────── */

.error-card {
  text-align: center;
  padding: 48px 24px !important;
}

.error-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--red);
}

.error-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
  .container {
    padding: 48px 16px 32px;
  }

  .monitor-card {
    padding: 18px;
  }

  .bars {
    gap: 1px;
    height: 28px;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
