/*
 * EasyDot Status Dashboard — Design System
 * Style tokens and base components mirroring easydot-home (easydot.ai)
 */

/* ─── Fonts (identical to easydot-home) ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Brand (from easydot-home) */
  --bg:         #021713;
  --mint:       #90FFD8;
  --mint-dim:   rgba(144, 255, 216, 0.60);
  --mint-glow:  rgba(144, 255, 216, 0.12);
  --white:      #FFFFFF;
  --off:        rgba(255, 255, 255, 0.52);
  --muted:      rgba(255, 255, 255, 0.32);
  --border:     rgba(255, 255, 255, 0.08);

  /* Fonts */
  --serif:   'Cormorant Garamond', Georgia, serif;
  --sans:    'Inter', system-ui, sans-serif;
  --display: 'Outfit', var(--sans);

  /* Status semantic colors */
  --good:    #90FFD8;
  --warn:    rgba(255, 196, 80, 0.90);
  --bad:     rgba(255, 90,  80, 0.85);
  --neutral: rgba(255, 255, 255, 0.18);

  /* Surface layers */
  --surface-1: rgba(4, 40, 30, 0.55);
  --surface-2: rgba(4, 40, 30, 0.30);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ─── Metaball Canvas ────────────────────────────────────────────────────── */
#metaball-canvas {
  position: fixed;
  inset: 0; width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}
#metaball-canvas.ready { opacity: 0.6; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 36px;
  position: relative;
  z-index: 1;
}

/* ─── Navigation (pill — from easydot-home) ──────────────────────────────── */
nav {
  position: fixed;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 48px);
  max-width: 1100px;
}

.nav-pill {
  background: rgba(4, 40, 30, 0.55);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(144, 255, 216, 0.12);
  border-radius: 100px;
  padding: 10px 12px 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.logo-svg { width: 28px; height: 28px; flex-shrink: 0; }
.brand-text {
  font-family: var(--display);
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.5px;
  color: var(--white);
}
.brand-text .dot   { color: var(--mint); }
.brand-text .slash { opacity: 0.3; margin: 0 4px; font-weight: 300; }
.brand-text .sub   { font-weight: 400; opacity: 0.7; font-size: 0.9em; }

/* Domain selector pills */
.domain-tabs {
  display: flex; align-items: center; gap: 4px; flex: 1;
  justify-content: center; list-style: none;
}
.domain-tab {
  font-size: 0.8rem; font-weight: 400; padding: 6px 14px;
  border-radius: 100px; cursor: pointer;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.2s;
  background: none;
  white-space: nowrap;
}
.domain-tab:hover  { color: var(--white); background: rgba(255,255,255,0.05); }
.domain-tab.active {
  background: var(--mint); color: #021713;
  font-weight: 600; border-color: transparent;
}

/* Time range tabs */
.time-tabs {
  display: flex; align-items: center; gap: 2px;
}
.time-tab {
  font-size: 0.75rem; font-weight: 400; padding: 5px 10px;
  border-radius: 100px; cursor: pointer;
  color: var(--muted); background: none;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.time-tab:hover  { color: var(--white); }
.time-tab.active {
  color: var(--mint);
  border-color: rgba(144,255,216,0.3);
  background: rgba(144,255,216,0.07);
}

/* ─── Page Content ───────────────────────────────────────────────────────── */
.page {
  padding-top: 120px;
  padding-bottom: 80px;
}

/* ─── Section headers (from easydot-home pattern) ────────────────────────── */
.section-label {
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mint); display: block; margin-bottom: 20px;
}
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mint);
  margin-bottom: 24px;
}
.eyebrow-line { width: 24px; height: 1px; background: var(--mint); opacity: 0.4; }

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 300; line-height: 1.08;
  letter-spacing: -0.02em; margin-bottom: 16px;
}
.section-title em { font-style: italic; color: var(--mint-dim); }

/* ─── Domain Status Cards ────────────────────────────────────────────────── */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.domain-card {
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 28px 22px;
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
  cursor: default;
}
.domain-card:hover {
  border-color: rgba(144, 255, 216, 0.22);
  background: rgba(4, 40, 30, 0.72);
  transform: translateY(-2px);
}

.card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px;
  margin-bottom: 18px;
}
.card-domain-row {
  display: flex; align-items: center; gap: 8px;
}

/* Status dot */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  transition: background 0.3s;
}
.status-dot.up      { background: var(--good); box-shadow: 0 0 8px var(--mint); }
.status-dot.warn    { background: var(--warn); }
.status-dot.down    { background: var(--bad);  animation: pulse-dot 1.5s ease-in-out infinite; }
.status-dot.unknown { background: var(--neutral); }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.6); opacity: 0.5; }
}

.card-domain {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--white);
}

/* Score badge (from easydot-home .tag) */
.score-badge {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid; border-radius: 100px;
  padding: 3px 9px; white-space: nowrap;
}
.score-badge.grade-a {
  color: var(--mint);
  border-color: rgba(144,255,216,0.3);
  background: rgba(144,255,216,0.07);
}
.score-badge.grade-b {
  color: var(--warn);
  border-color: rgba(255,196,80,0.3);
  background: rgba(255,196,80,0.07);
}
.score-badge.grade-cd {
  color: var(--bad);
  border-color: rgba(255,90,80,0.3);
  background: rgba(255,90,80,0.07);
}

/* Uptime big number */
.card-uptime {
  font-family: var(--display);
  font-size: 2.6rem; font-weight: 300;
  color: var(--mint); letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}
.card-uptime-label {
  font-size: 0.65rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  display: block; margin-bottom: 18px;
}

/* Mini metric pills row */
.card-metrics {
  display: flex; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.metric-pill {
  font-size: 0.68rem; letter-spacing: 0.04em;
  color: var(--off);
  border: 1px solid var(--border);
  border-radius: 100px; padding: 3px 9px;
}
.metric-pill span { color: var(--white); font-weight: 500; }

/* ─── Overall status banner ──────────────────────────────────────────────── */
.status-banner {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 40px;
  padding: 16px 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  opacity: 0;
  animation: rise 0.8s ease 0.1s forwards;
}
.status-banner.all-good { border-color: rgba(144,255,216,0.2); }
.status-banner.has-issue{ border-color: rgba(255,90,80,0.2); }
.banner-icon { font-size: 1.3rem; }
.banner-text { font-size: 0.9rem; color: var(--off); }
.banner-text strong { color: var(--white); }

/* ─── Metrics Section ────────────────────────────────────────────────────── */
.metrics-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 60px;
  padding: 40px;
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
}

/* Score big number (from easydot-home .stat-big) */
.score-big-wrap { text-align: center; min-width: 160px; }
.score-big {
  font-family: var(--serif);
  font-size: clamp(4.5rem, 10vw, 7rem);
  font-weight: 300; letter-spacing: -0.04em;
  color: var(--mint); line-height: 1;
  display: block;
}
.score-grade {
  font-family: var(--display);
  font-size: 1rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-top: 8px; display: block;
  opacity: 0.7;
}
.score-label {
  font-size: 0.65rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  display: block; margin-top: 4px;
}

/* Metric rows (from easydot-home .value-item) */
.metric-rows { border-top: 1px solid var(--border); }
.metric-row {
  display: grid;
  grid-template-columns: 80px 80px 1fr 100px;
  gap: 20px; align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.metric-row-label {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.metric-row-value {
  font-family: var(--display);
  font-size: 1rem; font-weight: 500;
  color: var(--white);
}
.metric-bar-track {
  height: 3px; background: var(--border);
  border-radius: 100px; overflow: visible;
}
.metric-bar-fill {
  height: 100%; border-radius: 100px;
  transition: width 1s ease;
}
.metric-bar-fill.good { background: var(--good); }
.metric-bar-fill.warn { background: var(--warn); }
.metric-bar-fill.bad  { background: var(--bad); }
.metric-row-status {
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  border: 1px solid; text-align: center;
  white-space: nowrap;
}
.metric-row-status.good { color: var(--mint); border-color: rgba(144,255,216,0.3); background: rgba(144,255,216,0.07); }
.metric-row-status.warn { color: var(--warn); border-color: rgba(255,196,80,0.3);  background: rgba(255,196,80,0.07); }
.metric-row-status.bad  { color: var(--bad);  border-color: rgba(255,90,80,0.3);   background: rgba(255,90,80,0.07); }

/* ─── Probe Map ──────────────────────────────────────────────────────────── */
.map-section {
  margin-bottom: 60px;
  padding: 36px;
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
}
.map-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 28px;
}
.map-container {
  position: relative; width: 100%;
  line-height: 0;
}
.world-map {
  width: 100%; height: auto;
  opacity: 0.7;
}
.world-map path {
  fill: rgba(255,255,255,0.04);
  stroke: rgba(255,255,255,0.08);
  stroke-width: 0.3;
}
.map-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
/* Probe nodes rendered by map.js via canvas */

/* Tooltip */
.map-tooltip {
  position: fixed;
  background: rgba(4, 40, 30, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.8rem; min-width: 160px;
  pointer-events: none;
  z-index: 200;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.map-tooltip.visible { display: block; }
.tooltip-region { font-weight: 600; margin-bottom: 6px; color: var(--white); }
.tooltip-row    { display: flex; justify-content: space-between; gap: 16px; color: var(--off); }
.tooltip-good   { color: var(--mint); }
.tooltip-warn   { color: var(--warn); }
.tooltip-bad    { color: var(--bad); }

/* Region legend */
.region-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px;
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--muted);
}
.legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* ─── Chart Section ──────────────────────────────────────────────────────── */
.charts-section {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 60px;
}

.chart-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
}
.chart-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  margin-bottom: 20px;
}
.chart-title {
  font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.chart-canvas-el {
  width: 100%; display: block;
}

/* Region color legend for charts */
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 14px;
}
.chart-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.68rem; color: var(--muted);
}
.chart-legend-line { width: 16px; height: 2px; border-radius: 1px; }

/* ─── Incidents Section ──────────────────────────────────────────────────── */
.incidents-section {
  margin-bottom: 60px;
  padding: 36px;
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
}

/* From easydot-home .phases */
.incident-list { border-top: 1px solid var(--border); }
.incident-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 32px; align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.incident-row:hover { background: rgba(144,255,216,0.015); }

/* Time (from easydot-home .phase-num) */
.incident-time {
  font-family: var(--serif);
  font-size: 1.8rem; font-weight: 300;
  color: var(--muted); letter-spacing: -0.02em;
  line-height: 1;
}
.incident-time-sub {
  font-size: 0.65rem; color: var(--muted);
  letter-spacing: 0.08em; margin-top: 4px;
  opacity: 0.6; display: block;
}

.incident-content h4 {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 400;
  letter-spacing: -0.01em; margin-bottom: 2px;
}
.incident-content p {
  font-size: 0.82rem; color: var(--off);
  font-weight: 300; line-height: 1.5;
}

/* Status badge (from easydot-home .phase-status) */
.incident-status {
  font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid; padding: 5px 12px;
  border-radius: 100px; white-space: nowrap;
}
.incident-status.resolved {
  color: var(--mint); border-color: rgba(144,255,216,0.3);
  background: rgba(144,255,216,0.05);
}
.incident-status.active {
  color: var(--bad); border-color: rgba(255,90,80,0.3);
  background: rgba(255,90,80,0.05);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.no-incidents {
  padding: 48px 0; text-align: center;
  font-size: 0.9rem; color: var(--muted);
}
.no-incidents-icon { font-size: 2rem; margin-bottom: 12px; display: block; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0; position: relative; z-index: 1;
}
.footer-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 24px;
}
.footer-copy { font-size: 0.78rem; color: var(--muted); }
.footer-link {
  font-size: 0.78rem; color: var(--muted);
  text-decoration: none; transition: color 0.2s;
}
.footer-link:hover { color: var(--white); }

/* ─── Loading skeleton ───────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Animations (from easydot-home) ────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-rise { opacity: 0; animation: rise 0.8s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .metrics-section { grid-template-columns: 1fr; gap: 32px; }
  .charts-section  { grid-template-columns: 1fr; }
  .incident-row    { grid-template-columns: 80px 1fr; }
  .incident-status { display: none; }
  .domain-tabs     { display: none; }
  .time-tabs .time-tab:not(.active) { display: none; }
}

@media (max-width: 600px) {
  nav { width: calc(100% - 32px); }
  .metric-row { grid-template-columns: 60px 60px 1fr; }
  .metric-row-status { display: none; }
}
