/* ===== BASE ===== */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Ubuntu, sans-serif;
  color: #f1f5f9;
}

/* Atmospheric background */
body {
  background:
    linear-gradient(
      rgba(15, 23, 42, 0.85),
      rgba(15, 23, 42, 0.85)
    ),
    url("/assets/rain1.jpg") center / cover fixed no-repeat;
}

/* Layout container */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ===== HEADER ===== */
h1 {
  margin-bottom: 0.2rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.tagline {
  margin-top: 0;
  color: #94a3b8;
  font-style: italic;
}

/* ===== COMPOSITE LAYOUT ===== */


/* ===== VALIDATOR CARD ===== */
/* ===== VALIDATOR CARD (FIXED) ===== */
#validator-status {
  max-width: 420px;   /* hard cap to prevent stretching */
  margin: 2.5rem auto 0;

  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;

  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  animation: fadeIn 0.8s ease-out;
}

#validator-status h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

#validator-status .stats li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

/* Status row */
.status-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.6rem;
}

.light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 0.6rem;
  background: gray;
}

.light.green {
  background: #3cb371;
  animation: greenPulse 3.2s ease-in-out infinite;
}

.light.yellow { background: #f0c419; }
.light.red { background: #d9534f; }

/* Stats list */
.stats {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0;
}

.stats li {
  margin: 0.25rem 0;
}

/* Sparkline */
#sparkline {
  margin-top: 0.6rem;
}

.updated {
  margin-top: 0.3rem;
  font-size: 0.8em;
  color: #94a3b8;
}

/* ===== NETWORK METRICS ===== */
#network-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 1.2rem;
}

/* Metric cards */
.metric-card {
  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.metric-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  opacity: 0.75;
}

.metric-value {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== TOOLTIP ===== */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 260px;
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  text-align: center;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  font-size: 0.75rem;
  line-height: 1.4;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 50;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ===== ABOUT & FOOTER ===== */
#about-validator {
  margin-top: 3rem;
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
  color: #cbd5f5;
}

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.9em;
  text-decoration: none;
}

.footer-links a:hover {
  color: #e2e8f0;
}

.footer-note {
  margin-top: 0.75rem;
  font-size: 0.75em;
  color: #64748b;
}

/* ===== AGREEMENT COLORS ===== */
.agree-perfect { color: #3cb371; }
.agree-normal { color: #f1f5f9; }
.agree-stale { color: #64748b; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes greenPulse {
  0% { box-shadow: 0 0 6px rgba(60, 179, 113, 0.55); }
  50% {
    box-shadow:
      0 0 10px rgba(60, 179, 113, 0.7),
      0 0 18px rgba(60, 179, 113, 0.35);
  }
  100% { box-shadow: 0 0 6px rgba(60, 179, 113, 0.55); }
}

/* ===== RESPONSIVE ===== */
/* ===== NETWORK METRICS (FINAL, STABLE) ===== */
#network-metrics {
  margin: 2rem auto 0;
  max-width: 560px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

@media (max-width: 720px) {
  #network-metrics {
    grid-template-columns: repeat(2, 1fr);
    max-width: 420px;
  }
}
