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

:root {
  --bg: #0a0c0f;
  --surface: #111418;
  --border: #1e2328;
  --border-bright: #2a3040;
  --text: #e8edf2;
  --muted: #4a5568;
  --accent: #00d4ff;
  --green: #00e676;
  --red: #ff3d57;
  --yellow: #ffb300;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'Space Grotesk', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.wrapper {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* Header */
header {
  margin-bottom: 56px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.25);
  padding: 5px 12px;
  margin-bottom: 20px;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 14px;
}

h1 span {
  color: var(--accent);
}

.subtitle {
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
  max-width: 420px;
  line-height: 1.6;
}

/* Input area */
.input-section {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}

.input-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 14px 16px;
  resize: vertical;
  min-height: 130px;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--muted); }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.select-nodes {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
}

.select-nodes:focus { border-color: var(--accent); color: var(--text); }

.btn-check {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 24px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-check:hover { opacity: 0.85; }
.btn-check:active { transform: scale(0.97); }
.btn-check:disabled { opacity: 0.4; cursor: not-allowed; }

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}

.stats-bar.visible { opacity: 1; }

.stat {
  flex: 1;
  padding: 14px 20px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.stat:last-child { border-right: none; }

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
}

.stat-value.up   { color: var(--green); }
.stat-value.down { color: var(--red); }
.stat-value.total { color: var(--accent); }

/* Table */
.table-container {
  border: 1px solid var(--border);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--surface);
  border-bottom: 1px solid var(--border-bright);
}

th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
}

th:last-child { text-align: right; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  animation: rowIn 0.3s ease both;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

td {
  padding: 14px 16px;
  font-size: 13px;
  vertical-align: middle;
}

.td-domain {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-status { width: 110px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
}

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

.status-pill.up      { color: var(--green);  background: rgba(0,230,118,0.08); }
.status-pill.down    { color: var(--red);    background: rgba(255,61,87,0.08); }
.status-pill.slow    { color: var(--yellow); background: rgba(255,179,0,0.08); }
.status-pill.pending { color: var(--muted);  background: rgba(255,255,255,0.04); }

.status-pill.up      .dot { background: var(--green); }
.status-pill.down    .dot { background: var(--red);    animation: blink 1s infinite; }
.status-pill.slow    .dot { background: var(--yellow); animation: blink 1.2s infinite; }
.status-pill.pending .dot { background: var(--muted);  animation: blink 0.7s infinite; }

.td-code {
  font-family: var(--font-mono);
  font-size: 12px;
  width: 70px;
}

.code-200 { color: var(--green); }
.code-3xx { color: var(--accent); }
.code-4xx,
.code-5xx { color: var(--red); }
.code-null { color: var(--muted); }

.td-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  width: 80px;
}

.td-nodes {
  text-align: right;
  width: 120px;
}

.node-dots {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.node-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--border-bright);
  transition: background 0.3s;
  cursor: default;
}

.node-dot.ok   { background: var(--green); }
.node-dot.fail { background: var(--red); }
.node-dot.spin { background: var(--yellow); animation: blink 0.6s infinite; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--border-bright);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  padding: 60px 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.empty-icon {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* Progress bar */
.progress-bar {
  height: 2px;
  background: var(--border);
  margin-bottom: 16px;
  overflow: hidden;
  display: none;
}

.progress-bar.active { display: block; }

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
  width: 0%;
}

footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

footer span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ─── Source tabs ─────────────────────────────────────────────────────────── */

.source-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.source-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.source-tab:hover { color: var(--text); }

.source-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── Tab panels ──────────────────────────────────────────────────────────── */

.tab-panel { display: block; }
.tab-panel.hidden { display: none; }

/* ─── File drop zone ──────────────────────────────────────────────────────── */

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 130px;
  border: 1px dashed var(--border-bright);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  padding: 24px;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.03);
}

.file-drop input[type="file"] {
  display: none;
}

.file-drop-icon {
  font-size: 28px;
  color: var(--muted);
  line-height: 1;
}

.file-drop-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.file-drop-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ─── Asset panel ─────────────────────────────────────────────────────────── */

.asset-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.asset-path {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.asset-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.asset-status.loaded { color: var(--green); }
.asset-status.error  { color: var(--red); }

#assetPreview {
  background: rgba(0, 212, 255, 0.02);
  color: var(--muted);
  cursor: default;
}

#assetPreview:focus { border-color: var(--border); }
