/* ═══════════════════════════════════════════════════════════
   RexChain Explorer — BscScan Style
   Light top-header + dark body, BSC gold accent
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* BscScan uses a near-black dark body with white/light-grey header */
  --nav-bg:          #12161c;
  --nav-border:      #1e2329;
  --body-bg:         #0b0e11;
  --panel-bg:        #12161c;
  --card-bg:         #1a1e27;
  --card-border:     #21262f;
  --hover-bg:        #1f242d;
  --input-bg:        #0d1117;

  --gold:            #f0b90b;
  --gold-hover:      #f8d12f;
  --gold-dim:        rgba(240,185,11,0.18);
  --gold-border:     rgba(240,185,11,0.35);

  --text-primary:    #eaecef;
  --text-secondary:  #848e9c;
  --text-muted:      #5a6272;
  --text-label:      #474d57;

  --green:           #0ecb81;
  --red:             #f6465d;
  --blue:            #1e80ff;
  --purple:          #9b8afb;

  --font:            'Inter', sans-serif;
  --mono:            'JetBrains Mono', monospace;
  --radius:          6px;
  --radius-sm:       4px;
  --shadow:          0 2px 8px rgba(0,0,0,0.5);
  --shadow-lg:       0 8px 32px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--body-bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); text-decoration: underline; }

/* ── TOP ANNOUNCEMENT STRIP (like BSC) ── */
.announce-bar {
  background: var(--gold);
  color: #000;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  letter-spacing: 0.3px;
}
.announce-bar a { color: #000; text-decoration: underline; }

/* ── NAVBAR ── */
.navbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  margin-right: 28px;
  flex-shrink: 0;
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #000;
  letter-spacing: -1px;
}
.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.logo-text span { color: var(--gold); }

/* Nav links */
.nav-links {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  height: 56px;
}
.nav-links a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom-color: var(--gold);
}
.nav-links a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Nav right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.nav-search {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 280px;
  transition: border-color 0.2s;
}
.nav-search:focus-within { border-color: var(--gold); }
.nav-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 7px 12px;
  font-size: 12.5px;
  flex: 1;
  font-family: var(--font);
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search button {
  background: var(--gold);
  border: none;
  color: #000;
  padding: 7px 13px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s;
  flex-shrink: 0;
}
.nav-search button:hover { background: var(--gold-hover); }

/* ── PRICE/STATS STRIP (below navbar, like BSC) ── */
.stats-strip {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--card-border);
  overflow: hidden;
}
.stats-strip-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: stretch;
  height: 38px;
  gap: 0;
}
.strip-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-right: 1px solid var(--card-border);
  font-size: 12px;
  white-space: nowrap;
}
.strip-item:first-child { padding-left: 0; }
.strip-item:last-child { border-right: none; }
.strip-label { color: var(--text-muted); }
.strip-value { color: var(--text-primary); font-weight: 600; }
.strip-value.up { color: var(--green); }
.strip-sep { color: var(--text-muted); margin: 0 4px; }
.live-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,100% { opacity:1; box-shadow: 0 0 0 0 rgba(14,203,129,0.4); }
  50% { opacity:0.7; box-shadow: 0 0 0 4px rgba(14,203,129,0); }
}

/* ── HERO SECTION (BSC style: dark bg + large search) ── */
.hero {
  background: linear-gradient(135deg, #0b0e11 0%, #12161c 50%, #0f1318 100%);
  border-bottom: 1px solid var(--card-border);
  padding: 36px 20px 32px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(240,185,11,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}
.hero-sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 22px;
}

/* BSC search bar */
.search-bar {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 700px;
  margin: 0 auto;
}
.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,185,11,0.1);
}
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 13px 18px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
  background: var(--gold);
  border: none;
  color: #000;
  padding: 0 28px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.search-bar button:hover { background: var(--gold-hover); }

/* ── MAIN LAYOUT ── */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── OVERVIEW STAT CARDS (top row, like BSC) ── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.ov-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}
.ov-card:hover {
  border-color: rgba(240,185,11,0.3);
  transform: translateY(-1px);
}
.ov-icon {
  width: 38px; height: 38px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.ov-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 3px;
  font-weight: 500;
}
.ov-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.ov-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── SECTION HEADER (BSC style) ── */
.section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-hd-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-hd-icon {
  width: 6px; height: 18px;
  background: var(--gold);
  border-radius: 3px;
}
.section-hd-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.section-hd-link {
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
}
.section-hd-link:hover { color: var(--gold-hover); text-decoration: none; }

/* ── CARD ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.15);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── TABLE (BSC style) ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  background: rgba(0,0,0,0.2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 9px 16px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}
tbody tr:hover { background: var(--hover-bg); }
tbody tr:last-child { border-bottom: none; }
td {
  padding: 11px 16px;
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
}

/* ── HASH / ADDRESS ── */
.hash {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
}
.hash:hover { color: var(--gold-hover); text-decoration: none; }
.hash-short { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); }
.monospace { font-family: var(--mono); font-size: 12px; }

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.badge-success { background: rgba(14,203,129,0.12); color: var(--green); border: 1px solid rgba(14,203,129,0.25); }
.badge-warning { background: rgba(240,185,11,0.12); color: var(--gold); border: 1px solid rgba(240,185,11,0.25); }
.badge-danger  { background: rgba(246,70,93,0.12); color: var(--red); border: 1px solid rgba(246,70,93,0.25); }
.badge-info    { background: rgba(30,128,255,0.12); color: var(--blue); border: 1px solid rgba(30,128,255,0.25); }

/* ── TX TYPE ICON (like BSC's orange/green arrow) ── */
.tx-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.tx-icon-in  { background: rgba(14,203,129,0.12); color: var(--green); }
.tx-icon-out { background: rgba(246,70,93,0.12); color: var(--red); }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ── DETAIL PAGE (BSC style) ── */
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--text-primary); text-decoration: none; }
.page-breadcrumb .sep { color: var(--text-label); }
.page-breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title-badge {
  font-size: 12px;
  font-weight: 600;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  padding: 3px 10px;
  border-radius: 100px;
}

.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.detail-card-header {
  background: rgba(0,0,0,0.2);
  padding: 10px 20px;
  border-bottom: 1px solid var(--card-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.detail-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: start;
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-key {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 1px;
}
.detail-key .dkey-icon {
  width: 20px; height: 20px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.detail-val {
  color: var(--text-primary);
  font-size: 13px;
  word-break: break-all;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── COPY BTN ── */
.copy-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-dim); }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-top: 1px solid var(--card-border);
  justify-content: flex-end;
}
.page-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  transition: all 0.15s;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.page-btn.active { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 700; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── FOOTER (BSC style) ── */
.footer {
  background: var(--nav-bg);
  border-top: 1px solid var(--card-border);
  padding: 20px 0;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 13px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); font-size: 12px; }
.footer-links a:hover { color: var(--gold); text-decoration: none; }
.footer-copy { color: var(--text-label); font-size: 11.5px; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 999;
  max-width: 280px;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--body-bg); }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.empty-state .empty-icon { font-size: 28px; margin-bottom: 8px; opacity: 0.5; }

/* ── NETWORK BADGE (top-right of navbar) ── */
.net-badge {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .overview-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .overview-grid { grid-template-columns: 1fr; }
  .nav-search { display: none; }
  .stats-strip-inner { overflow-x: auto; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .nav-links a { padding: 0 10px; font-size: 12px; }
  .hero h1 { font-size: 20px; }
  .net-badge { display: none; }
}
