/* ═══════════════════════════════════════════════════════
   Anonyma Explorer — Palavia Design Language
   Zinc dark-mode · Inter · Rounded cards · Subtle depth
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:       #09090b;
  --bg-sub:   #0c0c0f;
  --surface:  #18181b;
  --surface2: #27272a;
  --surface3: #3f3f46;
  --border:   #27272a;
  --border2:  #3f3f46;
  --text:     #e4e4e7;
  --text2:    #a1a1aa;
  --text3:    #71717a;
  --text4:    #52525b;
  --white:    #fafafa;
  --accent:   #a78bfa;
  --accent2:  #7c3aed;
  --green:    #22c55e;
  --green-bg: rgba(34,197,94,.1);
  --red:      #ef4444;
  --radius:   14px;
  --radius-sm:10px;
  --radius-xs: 8px;
  --shadow:   0 1px 3px rgba(0,0,0,.4), 0 4px 20px rgba(0,0,0,.3);
  --shadow-lg:0 4px 24px rgba(0,0,0,.5), 0 12px 48px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ════════════════════════════════
   Navbar
   ════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9,9,11,.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
}

.nav-left { display: flex; align-items: center; gap: 10px; }

.logo-mark {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--accent);
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}
.logo-accent {
  color: var(--text3);
  font-weight: 500;
  margin-left: 2px;
}

.chain-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text3);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.chain-pill.ok {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(34,197,94,.2);
}
.chain-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ════════════════════════════════
   Main
   ════════════════════════════════ */
main {
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 28px 48px;
}

/* ════════════════════════════════
   Stats Grid
   ════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.stat-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: var(--radius-xs);
  color: var(--text3);
  flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; gap: 4px; }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
}
.stat-value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--white);
  letter-spacing: -0.5px;
}

/* ════════════════════════════════
   Search
   ════════════════════════════════ */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 4px 4px 16px;
  margin-bottom: 22px;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--accent); }

.search-icon { color: var(--text4); flex-shrink: 0; display: flex; }

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--text4); }

.search-bar button {
  background: var(--accent2);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.search-bar button:hover { background: var(--accent); }

/* ════════════════════════════════
   Tabs
   ════════════════════════════════ */
.tab-nav {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.tab:hover { color: var(--text2); background: var(--surface2); }
.tab.active {
  background: var(--surface2);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ════════════════════════════════
   Panels
   ════════════════════════════════ */
.panel { display: none; }
.panel.active { display: block; animation: fadeUp .2s ease-out; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════
   Cards
   ════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}
.card-subtitle {
  font-size: 11px;
  color: var(--text4);
  margin-top: 2px;
  display: block;
}

.card-body { padding: 20px 22px; }

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

/* ════════════════════════════════
   Table
   ════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 11px 18px;
  font-weight: 600;
  color: var(--text3);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg-sub);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(39,39,42,.5);
  color: var(--text2);
  font-size: 13px;
}

tbody tr { transition: background .1s; }
tbody tr:hover { background: rgba(39,39,42,.35); }
tbody tr:last-child td { border-bottom: none; }

/* ── Clickable links ── */
.addr-link, .hash-link, .block-link {
  color: var(--accent);
  cursor: pointer;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  letter-spacing: -0.2px;
  transition: color .15s;
}
.addr-link:hover, .hash-link:hover, .block-link:hover {
  color: #c4b5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ════════════════════════════════
   Buttons
   ════════════════════════════════ */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 8px 24px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
  font-family: inherit;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }

.btn-primary {
  background: var(--accent2);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--accent); }

/* ════════════════════════════════
   Form
   ════════════════════════════════ */
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.form-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}
.form-row input:focus { border-color: var(--accent); }
.form-row input::placeholder { color: var(--text4); }

/* ════════════════════════════════
   Account Card
   ════════════════════════════════ */
.account-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.account-card h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 10px;
}
.account-card .addr {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  color: var(--accent);
  word-break: break-all;
  line-height: 1.5;
}
.account-card .bal {
  font-size: 30px;
  font-weight: 800;
  color: var(--white);
  margin: 10px 0 4px;
  letter-spacing: -0.5px;
}
.account-card .nonce {
  font-size: 12px;
  color: var(--text3);
}

/* ════════════════════════════════
   Modals
   ════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  max-width: 600px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-wide { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.modal-close {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }

.modal-body { padding: 8px 0; }

.detail-row {
  display: flex;
  gap: 14px;
  padding: 11px 24px;
  border-bottom: 1px solid rgba(39,39,42,.4);
  font-size: 13px;
  transition: background .1s;
}
.detail-row:hover { background: rgba(39,39,42,.25); }
.detail-row:last-child { border-bottom: none; }

.detail-label {
  color: var(--text3);
  min-width: 90px;
  flex-shrink: 0;
  font-weight: 500;
  font-size: 12px;
}
.detail-value {
  word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  flex: 1;
  color: var(--text);
}
.detail-value pre {
  white-space: pre-wrap;
  font-size: 11px;
  max-height: 200px;
  overflow: auto;
  background: var(--surface2);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  border: 1px solid var(--border);
  margin: 2px 0;
  color: var(--text2);
  line-height: 1.6;
}

/* ════════════════════════════════
   Empty States
   ════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--text4);
  font-size: 13px;
  text-align: center;
}
.empty-msg {
  text-align: center;
  color: var(--text4);
  padding: 40px;
  font-size: 13px;
}

.hidden { display: none !important; }

/* ════════════════════════════════
   Footer
   ════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 18px;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text4);
}
.footer-sep { opacity: .4; }

/* ════════════════════════════════
   Responsive
   ════════════════════════════════ */
@media (max-width: 680px) {
  .stats-grid { grid-template-columns: 1fr; }
  .navbar-inner, main { padding-left: 16px; padding-right: 16px; }
  .search-bar { flex-wrap: wrap; }
  .search-bar input { min-width: 0; }
  .modal { border-radius: 14px; margin: 12px; }
  .detail-row { flex-direction: column; gap: 4px; }
  .detail-label { min-width: 0; }
}
