/* =============================================================================
   MYTHERRA EXPLORER - MAIN STYLESHEET (Etherscan-near)
   Clean, compact, neutral, professional explorer UI
   - calmer typography, tighter rhythm, subtle hover, thin borders
   - minimal shadows, consistent radii
   - compatible with existing class names in your PHP templates
   ============================================================================= */

/* -----------------------------
   Design Tokens (Etherscan-ish)
------------------------------ */
:root {
  /* Brand */
  --primary: #1b60f0;
  --primary-dark: #1147c7;
  --primary-soft: #eef4ff;

  /* Accents */
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --warning: #f59e0b;
  --warning-soft: #fff7ed;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --pending: #f97316;
  --pending-soft: #fff7ed;

  /* Neutrals */
  --bg: #f6f8fb;          /* etherscan-style background */
  --surface: #ffffff;     /* cards */
  --surface-2: #f8fafc;   /* header rows */
  --surface-3: #f1f5f9;   /* code/chips */

  --border: #e7eaf3;      /* thin bluish-grey */
  --border-2: #dfe4f1;

  /* Text */
  --text: #0b1320;
  --text-2: #334155;
  --text-3: #6b7a90;
  --link: var(--primary);

  /* Radius */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* Shadows (very subtle like Etherscan) */
  --shadow-xs: 0 1px 0 rgba(2, 6, 23, 0.04);
  --shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.05);
  --shadow:    0 8px 22px rgba(2, 6, 23, 0.08);

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* Typography (etherscan is compact) */
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
          Inter, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
          "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
          "Courier New", monospace;

  --fz-xs: 12px;
  --fz-sm: 13px;
  --fz-md: 14px;   /* base */
  --fz-lg: 16px;
  --fz-xl: 18px;
  --fz-2xl: 22px;

  --transition: 140ms ease;
}

/* -----------------------------
   Base / Reset
------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fz-md);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { max-width: 100%; height: auto; }
p { margin: 0; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

/* Better keyboard focus */
:focus-visible {
  outline: 3px solid rgba(27, 96, 240, 0.22);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Selection */
::selection {
  background: rgba(27, 96, 240, 0.16);
}

/* -----------------------------
   Layout
------------------------------ */
.container {
  width: 100%;
  max-width: 1300px; /* etherscan feels tighter */
  margin: 0 auto;
  padding: 0 var(--s-4);
}

.main { flex: 1; padding: var(--s-8) 0; }

/* -----------------------------
   Optional: Topbar (Etherscan-like info strip)
   Use: <div class="topbar"><div class="container">...</div></div>
------------------------------ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: var(--fz-sm);
  color: var(--text-3);
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 10px var(--s-4);
}
.topbar a { color: var(--text-2); font-weight: 600; }
.topbar a:hover { color: var(--primary-dark); }
.topbar .topbar-left,
.topbar .topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.topbar .sep { opacity: 0.5; }

/* -----------------------------
   Header / Nav (solid, calm)
------------------------------ */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: var(--s-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 800;
  letter-spacing: -0.015em;
  font-size: var(--fz-xl);
  color: var(--text);
}
.logo:hover { color: var(--primary); }
.logo-icon { color: var(--primary); font-size: 20px; }

.nav-menu {
  display: flex;
  list-style: none;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-weight: 650;
  font-size: var(--fz-sm);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.nav-menu a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(27, 96, 240, 0.14);
}

.nav-menu a.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(27, 96, 240, 0.18);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 10px;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* -----------------------------
   Sync Banner
------------------------------ */
.sync-banner {
  background: var(--warning-soft);
  color: #9a3412;
  padding: 10px 0;
  font-size: var(--fz-sm);
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
}

.sync-banner svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -----------------------------
   Search (clean, not too "glowy")
------------------------------ */
.search-box { padding: var(--s-4) 0 var(--s-6); }

.search-form {
  display: flex;
  gap: 0;
  max-width: 880px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-right: none;
  border-radius: var(--r-md) 0 0 var(--r-md);
  font-size: var(--fz-md);
  outline: none;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--text-3); }

.search-input:focus {
  border-color: rgba(27, 96, 240, 0.40);
  box-shadow: 0 0 0 4px rgba(27, 96, 240, 0.10);
}

.search-btn {
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.search-btn:active { transform: translateY(1px); }

/* -----------------------------
   Cards (etherscan calm)
------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card + .card { margin-top: var(--s-6); }

.card-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.card-header h2,
.card-header h3 {
  margin: 0;
  font-size: var(--fz-lg);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.card-body { padding: 14px; }

.card-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
  color: var(--text-3);
  font-size: var(--fz-sm);
}

/* -----------------------------
   Stats Grid (top summary)
------------------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  border-color: rgba(2, 6, 23, 0.12);
  box-shadow: var(--shadow-sm);
}



.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon svg { opacity: 0.92; }

.stat-icon.blue   { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green  { background: var(--success-soft); color: var(--success); }
.stat-icon.yellow { background: var(--warning-soft); color: var(--warning); }
.stat-icon.orange { background: var(--pending-soft); color: var(--pending); }

.stat-info { flex: 1; min-width: 0; }

.stat-label {
  font-size: var(--fz-xs);
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

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

/* -----------------------------
   Tables (Etherscan-like rhythm)
------------------------------ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  padding: 11px 12px; /* more compact */
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

.table th {
  font-size: var(--fz-xs);
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
}

.table tbody tr:hover { background: rgba(2, 6, 23, 0.02); }
.table tbody tr:last-child td { border-bottom: none; }

/* Table helpers */
.cell-hash { font-family: var(--mono); font-size: var(--fz-sm); }
.cell-amount { font-family: var(--mono); font-weight: 700; text-align: right; }
.cell-time { color: var(--text-3); font-size: var(--fz-sm); }
.cell-number { text-align: center; }

/* Links in tables */
.table a { font-weight: 650; }
.table a.cell-hash { font-weight: 750; }

/* -----------------------------
   Badges (small, clean)
------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fz-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.badge-success   { background: var(--success-soft); color: var(--success); border-color: rgba(22, 163, 74, 0.18); }
.badge-pending   { background: var(--pending-soft); color: var(--pending); border-color: rgba(249, 115, 22, 0.18); }
.badge-primary   { background: var(--primary-soft); color: var(--primary); border-color: rgba(27, 96, 240, 0.18); }
.badge-secondary { background: var(--surface-3);   color: var(--text-2);  border-color: rgba(100, 116, 139, 0.18); }

/* -----------------------------
   Buttons (Etherscan-ish: not too round, not too puffy)
------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fz-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  user-select: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-2);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: rgba(2, 6, 23, 0.16);
}

.btn-sm {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fz-xs);
}

/* -----------------------------
   Detail Pages
------------------------------ */
.detail-header { margin-bottom: var(--s-6); }

.detail-header h1 {
  font-size: var(--fz-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-3) 0;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.detail-hash {
  font-family: var(--mono);
  font-size: var(--fz-sm);
  color: var(--text-2);
  word-break: break-all;
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 9px 10px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 6px;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.copy-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(27, 96, 240, 0.22);
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: var(--s-4);
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
  width: 180px;
  flex-shrink: 0;
  color: var(--text-3);
  font-weight: 800;
  font-size: var(--fz-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 2px;
}

.detail-value { flex: 1; word-break: break-word; color: var(--text); }
.detail-value.mono { font-family: var(--mono); font-size: var(--fz-sm); color: var(--text-2); }

/* -----------------------------
   TX Flow
------------------------------ */
.tx-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-6);
  align-items: start;
  margin: var(--s-6) 0;
}

.tx-inputs, .tx-outputs { display: flex; flex-direction: column; gap: var(--s-3); }

.tx-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  color: var(--text-3);
  font-size: 26px;
  opacity: 0.8;
}

.tx-io-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 12px;
}

.tx-io-address {
  font-family: var(--mono);
  font-size: var(--fz-sm);
  margin-bottom: 6px;
  word-break: break-all;
  color: var(--text-2);
}

.tx-io-amount {
  font-family: var(--mono);
  font-weight: 800;
  font-size: var(--fz-sm);
}

.tx-io-amount.sent { color: var(--danger); }
.tx-io-amount.received { color: var(--success); }

/* -----------------------------
   Pagination
------------------------------ */
.pagination { display: flex; justify-content: center; margin-top: var(--s-6); }

.pagination ul {
  display: flex;
  list-style: none;
  gap: 6px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fz-sm);
  font-weight: 750;
  color: var(--text-2);
  background: var(--surface);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.pagination li a:hover {
  background: var(--primary-soft);
  border-color: rgba(27, 96, 240, 0.22);
  color: var(--primary-dark);
}

.pagination li.active span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination li.disabled span {
  color: var(--text-3);
  background: var(--surface-2);
}

/* -----------------------------
   Alerts
------------------------------ */
.alert {
  padding: 12px 14px;
  border-radius: var(--r-lg);
  margin-bottom: var(--s-5);
  font-size: var(--fz-sm);
  border: 1px solid transparent;
}

.alert-info    { background: var(--primary-soft); color: var(--primary-dark); border-color: rgba(27, 96, 240, 0.18); }
.alert-success { background: var(--success-soft); color: #166534; border-color: rgba(22, 163, 74, 0.18); }
.alert-warning { background: var(--warning-soft); color: #9a3412; border-color: rgba(245, 158, 11, 0.18); }
.alert-error   { background: var(--danger-soft);  color: var(--danger);      border-color: rgba(220, 38, 38, 0.18); }

/* -----------------------------
   Home Grid / List Items
------------------------------ */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-6);
}

.list-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  gap: var(--s-4);
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(2, 6, 23, 0.02); }

.list-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--fz-sm);
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
}

.list-icon.block { background: var(--primary-soft); color: var(--primary); border-color: rgba(27, 96, 240, 0.18); }
.list-icon.tx    { background: var(--success-soft); color: var(--success); border-color: rgba(22, 163, 74, 0.18); }

.list-content { flex: 1; min-width: 0; }
.list-primary { font-weight: 750; margin: 0 0 4px 0; color: var(--text); }
.list-secondary { font-size: var(--fz-sm); color: var(--text-3); }

.list-meta { text-align: right; flex-shrink: 0; }
.list-meta-primary { font-weight: 800; font-family: var(--mono); font-size: var(--fz-sm); }
.list-meta-secondary { font-size: var(--fz-xs); color: var(--text-3); }

/* -----------------------------
   Empty State
------------------------------ */
.empty-state {
  text-align: center;
  padding: var(--s-10) var(--s-6);
  color: var(--text-3);
}

.empty-state-icon {
  font-size: 44px;
  margin-bottom: var(--s-3);
  opacity: 0.6;
}

.empty-state-title {
  font-size: var(--fz-lg);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

/* -----------------------------
   Footer (clean)
------------------------------ */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--s-8) 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-6);
  margin-bottom: var(--s-6);
}

.footer-logo { font-weight: 800; font-size: var(--fz-lg); letter-spacing: -0.01em; }
.footer-info p { color: var(--text-3); font-size: var(--fz-sm); margin-top: var(--s-1); }

.footer-links { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.footer-links a { color: var(--text-3); font-size: var(--fz-sm); font-weight: 650; }
.footer-links a:hover { color: var(--primary-dark); }

.footer-stats { display: flex; gap: var(--s-6); font-size: var(--fz-sm); color: var(--text-3); flex-wrap: wrap; }
.footer-stats strong { color: var(--text); font-weight: 800; }

.footer-bottom {
  text-align: center;
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
  font-size: var(--fz-sm);
  color: var(--text-3);
}
/* Footer: Links untereinander pro Kategorie */
.footer-links {
  display: flex;
  gap: 48px;              /* Abstand zwischen den Kategorien */
  align-items: flex-start;
}

.footer-links-col {
  display: flex;
  flex-direction: column; /* <- macht die Spalte vertikal */
  gap: 10px;              /* Abstand zwischen Links */
  min-width: 160px;
}

.footer-links-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.footer-links-col a {
  display: block;         /* <- jeder Link eigene Zeile */
  line-height: 1.25;
}

/* -----------------------------
   Utilities
------------------------------ */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-3); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-mono, .mono { font-family: var(--mono); }
.font-bold { font-weight: 800; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--s-2); }
.mb-md { margin-bottom: var(--s-4); }
.mb-lg { margin-bottom: var(--s-6); }
.mt-md { margin-top: var(--s-4); }
.mt-lg { margin-top: var(--s-6); }

/* Optional small helpers (safe) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fz-sm);
  font-weight: 650;
}
.muted-link { color: var(--text-3); font-weight: 650; }
.muted-link:hover { color: var(--primary-dark); }

/* -----------------------------
   Responsive
------------------------------ */
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav { display: none; width: 100%; order: 3; }
  .nav.active { display: block; }
  .nav-menu { flex-direction: column; padding: var(--s-4) 0; }

  .mobile-menu-toggle { display: flex; }

  .search-form { flex-direction: column; gap: var(--s-2); }
  .search-input {
    border-right: 1px solid var(--border-2);
    border-radius: var(--r-md);
  }
  .search-btn {
    border-radius: var(--r-md);
    width: 100%;
  }

  .stats-grid { grid-template-columns: 1fr; }

  .tx-flow { grid-template-columns: 1fr; }
  .tx-arrow { transform: rotate(90deg); padding: 0; margin: var(--s-2) 0; }

  .detail-row { flex-direction: column; gap: var(--s-2); }
  .detail-label { width: 100%; }

  .footer-content { flex-direction: column; text-align: center; }
}

/* -----------------------------
   Reduced motion
------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .sync-banner svg { animation: none !important; }
}