/* ─────────────────────────────────────────────────────────────
 * ZephFlow Explorer — shared styles
 * Matches the ZephFlow Live Liquidity Dashboard aesthetic.
 * ───────────────────────────────────────────────────────────── */

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

:root {
  --bg:           #0E0E21;
  --bg-card:      #12102a;
  --bg-card-alt:  rgba(14,14,33,0.85);
  --bg-deep:      #0a0a18;
  --bg-row:       #1a1540;
  --border:       #282554;
  --border-light: rgba(99,72,255,0.15);
  --border-soft:  rgba(99,72,255,0.10);
  --text:         #F5F5FA;
  --text-muted:   #9490b0;
  --text-dim:     #5a5678;
  --text-faint:   #3d3960;
  --accent:       #6348FF;
  --accent-soft:  #b4a0ff;
  --accent-deep:  #4931AF;
  --green:        #3fb950;
  --green-soft:   #7dffb3;
  --red:          #FF616D;
  --amber:        #d29922;
  --shadow-card:  0 0 20px rgba(99,72,255,0.05), 0 0 40px rgba(99,72,255,0.02);
}

body.light-mode {
  --bg:           #F0EFF5;
  --bg-card:      #FFFFFF;
  --bg-card-alt:  rgba(255,255,255,0.9);
  --bg-deep:      #e8e6f2;
  --bg-row:       #f5f4fa;
  --border:       #d4d0e8;
  --border-light: rgba(99,72,255,0.12);
  --border-soft:  rgba(99,72,255,0.08);
  --text:         #161430;
  --text-muted:   #5a5678;
  --text-dim:     #827FAE;
  --text-faint:   #a09cc4;
  --accent:       #4931AF;
  --accent-soft:  #6348FF;
  --accent-deep:  #2e1d8a;
  --green:        #1a8a3e;
  --green-soft:   #1a8a3e;
  --red:          #d4404d;
  --shadow-card:  0 0 20px rgba(99,72,255,0.04), 0 0 40px rgba(99,72,255,0.02);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-soft); text-decoration: underline; }
body.light-mode a:hover { color: var(--accent-deep); }

code, .mono {
  font-family: 'SF Mono', 'Fira Code', Consolas, ui-monospace, monospace;
}

/* ───────── Theme toggle ───────── */
.theme-toggle {
  position: fixed; top: 12px; right: 12px; z-index: 999;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s; box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
body.light-mode .theme-toggle { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.theme-toggle:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(99,72,255,0.2); }
.theme-toggle svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ───────── Top header bar ───────── */
.top-bar {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 18px 24px;
}
.top-bar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, #6348FF 0%, #4931AF 100%);
  display: flex; align-items: center; justify-content: center;
  color: #F5F5FA;
  box-shadow: 0 2px 12px rgba(99,72,255,0.35);
  flex-shrink: 0;
}
.brand-mark svg { width: 65%; height: 65%; display: block; }
.brand-name { font-weight: 800; }
.brand-tag {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent);
  padding: 2px 8px; border: 1px solid rgba(99,72,255,0.35);
  border-radius: 20px; margin-left: 4px;
}

.nav-links {
  display: flex; align-items: center; gap: 18px;
  font-size: 13px; font-weight: 600;
}
.nav-links a {
  color: var(--text-muted); padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--text); border-bottom-color: var(--accent); text-decoration: none; }
.nav-links a.ext::after {
  content: '↗'; margin-left: 3px; font-size: 11px; opacity: 0.7;
}

/* ───────── Hero / search section ───────── */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-row) 40%, var(--bg) 100%);
  padding: 44px 24px 36px; text-align: center;
  border-bottom: 1px solid rgba(99,72,255,0.15);
}
body.light-mode .hero {
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%; pointer-events: none;
  background: radial-gradient(ellipse at 30% 50%, rgba(73,49,175,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(99,72,255,0.04) 0%, transparent 60%);
  animation: shimmer 20s ease-in-out infinite alternate;
}
@keyframes shimmer {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-5%, 3%); }
}
.hero-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }
.hero-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(99,72,255,0.35);
  padding: 4px 14px; border-radius: 20px; margin-bottom: 16px;
}
.hero h1 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.8px;
  line-height: 1.15; margin-bottom: 8px;
  background: linear-gradient(160deg, var(--text) 40%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 14px; color: var(--text-muted); margin-bottom: 22px;
}

/* ───────── Search ───────── */
.search-wrap {
  max-width: 720px; margin: 0 auto;
  display: flex; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,72,255,0.15);
}
.search-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; padding: 10px 14px;
  font-family: 'SF Mono', Consolas, monospace;
}
.search-input::placeholder { color: var(--text-dim); font-family: 'Inter', sans-serif; }
.search-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 0 22px; border-radius: 8px; font-weight: 600;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.search-btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.search-hint {
  margin-top: 10px; font-size: 11px; color: var(--text-dim);
}

/* ───────── Content layout ───────── */
.content {
  max-width: 1200px; margin: 0 auto; padding: 32px 24px 60px;
}
.section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);
  margin: 28px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px rgba(63,185,80,0.6);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.4; }
}

/* ───────── Stat cards grid ───────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  position: relative; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
  border-color: rgba(99,72,255,0.4);
  transform: translateY(-1px);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
}
.stat-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 22px; font-weight: 700; color: var(--text);
  font-family: 'SF Mono', Consolas, monospace;
  letter-spacing: -0.5px;
}
.stat-sub {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.stat-value.accent { color: var(--accent); }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }

/* ───────── Card / panel ───────── */
.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  margin-bottom: 24px;
}
.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.panel-title {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.panel-meta { font-size: 11px; color: var(--text-dim); }
.panel-body { padding: 0; }

/* ───────── Tables ───────── */
.tbl {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.tbl thead th {
  text-align: left; padding: 10px 16px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}
.tbl tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: rgba(99,72,255,0.04); }
.tbl tbody tr.new {
  animation: slideIn 0.6s ease-out;
}
@keyframes slideIn {
  from { background: rgba(99,72,255,0.18); }
  to   { background: transparent; }
}
.tbl .mono   { font-family: 'SF Mono', Consolas, monospace; font-size: 12px; }
.tbl .truncate {
  display: inline-block; max-width: 280px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.tbl .num {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Consolas, monospace;
}
.tbl .right { text-align: right; }

.cell-mute { color: var(--text-muted); }
.cell-strong { color: var(--text); font-weight: 600; }

.pill {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; padding: 2px 8px; border-radius: 20px;
  background: rgba(99,72,255,0.12); color: var(--accent);
  border: 1px solid rgba(99,72,255,0.25);
}
.pill.green { background: rgba(63,185,80,0.10);  color: var(--green); border-color: rgba(63,185,80,0.25); }
.pill.amber { background: rgba(210,153,34,0.10); color: var(--amber); border-color: rgba(210,153,34,0.25); }
.pill.red   { background: rgba(255,97,109,0.10); color: var(--red);   border-color: rgba(255,97,109,0.25); }
.pill.teal  { background: rgba(92,223,255,0.12); color: #5cdfff;       border-color: rgba(92,223,255,0.30); }
body.light-mode .pill.teal { color: #0a7c9c; background: rgba(10,124,156,0.10); border-color: rgba(10,124,156,0.30); }
.pill.muted { background: rgba(148,144,176,0.08); color: var(--text-dim); border-color: rgba(148,144,176,0.18); font-weight: 600; }

/* ───────── Two-column grid (blocks + transactions) ───────── */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ───────── Detail page (key/value rows) ───────── */
.kv {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 0;
}
.kv > .k, .kv > .v {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.kv > .k {
  color: var(--text-dim);
  font-weight: 600; letter-spacing: 0.3px;
  background: rgba(99,72,255,0.02);
}
.kv > .v {
  color: var(--text);
  font-family: 'SF Mono', Consolas, monospace;
  word-break: break-all;
}
.kv > .v.regular { font-family: inherit; }
.kv > div:nth-last-child(-n+2) { border-bottom: none; }

@media (max-width: 720px) {
  .kv { grid-template-columns: 1fr; }
  .kv > .k { padding-bottom: 4px; border-bottom: none; }
  .kv > .v { padding-top: 4px; }
}

/* ───────── Loading / empty / error ───────── */
.loading {
  text-align: center; padding: 40px 20px;
  color: var(--text-dim); font-size: 13px;
}
.loading::after {
  content: '...'; animation: dots 1.5s infinite;
}
@keyframes dots {
  0%   { content: '.'; }
  33%  { content: '..'; }
  66%  { content: '...'; }
}
.error {
  padding: 16px 20px; border-radius: 8px;
  background: rgba(255,97,109,0.08);
  border: 1px solid rgba(255,97,109,0.25);
  color: var(--red); font-size: 13px;
}
.empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 13px;
}

/* ───────── Footer ───────── */
.footer {
  text-align: center; padding: 32px 24px;
  color: var(--text-faint); font-size: 11px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}
.footer a { color: var(--accent-deep); }
.footer-row { margin: 6px 0; }
.footer-nodes {
  display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  margin-top: 8px;
}
.footer-node {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted);
}
.node-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); }
.node-dot.live { background: var(--green); box-shadow: 0 0 6px rgba(63,185,80,0.5); }
.node-dot.dead { background: var(--red); }

/* ───────── Mobile tweaks ───────── */
@media (max-width: 640px) {
  .top-bar { padding: 14px 16px; }
  .nav-links { gap: 14px; font-size: 12px; }
  .hero { padding: 32px 16px 28px; }
  .hero h1 { font-size: 24px; }
  .content { padding: 22px 14px 40px; }
  .stat-value { font-size: 18px; }
  .tbl thead th, .tbl tbody td { padding: 10px 12px; font-size: 12px; }
  .tbl .truncate { max-width: 140px; }
  .panel-header { padding: 12px 14px; }
  .kv > .k, .kv > .v { padding: 10px 14px; font-size: 12px; }
}
