:root {
  --primary: #f59e0b;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.25);
  --bg-dark: #0a0e17;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(245, 158, 11, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --danger: #ef4444;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #070a10 0%, #0a0e17 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #fbbf24;
  text-decoration: underline;
}

.mono {
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Header & Navbar */
.navbar-custom {
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.65rem 1.25rem;
}

.navbar-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
}

.brand-img {
  max-height: 42px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand-img:hover {
  transform: scale(1.02);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-card);
  color: #fff;
  font-size: 1.2rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.search-form {
  flex: 1;
  max-width: 440px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.55rem 2.5rem 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--primary-glow);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.search-btn:hover {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-glow);
  font-weight: 600;
}

/* Layout Container */
.main-content {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
}

/* Hero Banner */
.hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.65rem;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 680px;
}

.hero-coin-badge {
  padding-left: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinning-coin {
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.4));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
  position: relative;
}

.stat-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.text-primary { color: var(--primary) !important; }
.text-cyan { color: var(--cyan) !important; }
.text-success { color: #34d399 !important; }
.text-warning { color: #fbbf24 !important; }

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Chart Tab Group */
.chart-tab-group {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.chart-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.chart-tab:hover {
  color: #fff;
}

.chart-tab.active {
  background: var(--primary);
  color: #000;
}

/* Distribution Progress Bar */
.distribution-bar {
  display: flex;
  height: 12px;
  border-radius: 9999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
}

.dist-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.dist-1 { background: #f59e0b; }
.dist-2 { background: #06b6d4; }
.dist-3 { background: #10b981; }
.dist-4 { background: #eab308; }
.dist-5 { background: #64748b; }

/* Modern Data Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
  white-space: nowrap;
}

.custom-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-card);
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Address Link with Truncation */
.address-link {
  font-family: var(--font-mono);
  color: #38bdf8;
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.address-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.height-link {
  color: #fff;
  font-weight: 700;
}

.height-link:hover {
  color: var(--primary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-verified {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  font-size: 0.7rem;
  margin-left: 0.35rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.4; transform: scale(0.9); }
}

/* Forms & Inputs */
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

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

.btn-primary:hover {
  background: #fbbf24;
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-card);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
}

/* Alerts */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Code box */
.code-box {
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
}

/* Address Details Banner */
.address-banner {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.address-hash {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

/* Footer */
.footer-custom {
  background: rgba(8, 12, 20, 0.95);
  border-top: 1px solid var(--border-card);
  padding: 1.5rem 1.25rem;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  line-height: 1.6;
}

.footer-copy a {
  color: var(--primary);
  text-decoration: underline;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links {
  display: flex;
  gap: 0.85rem;
}

.social-link {
  color: var(--text-muted);
  font-size: 1.15rem;
  transition: color 0.2s;
}

.social-link:hover {
  color: var(--primary);
}

.footer-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Comprehensive Responsive Breakpoints */
@media (max-width: 1100px) {
  .hero-banner {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }
  .hero-coin-badge {
    padding-left: 0;
  }
  .grid-2col {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 991px) {
  .mobile-menu-btn {
    display: block;
  }
  .nav-menu {
    display: none;
    width: 100%;
    order: 4;
  }
  .nav-menu.active {
    display: block;
  }
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.75rem 0 0.25rem 0;
    width: 100%;
  }
  .nav-link {
    width: 100%;
    padding: 0.6rem 0.85rem;
  }
  .search-form {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
  .footer-right {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.35rem;
  }
  .card-title {
    font-size: 1rem;
  }
  .address-hash {
    font-size: 0.85rem;
  }
  .address-link {
    max-width: 180px;
  }
}

/* Pixel-Perfect Aligned Tables for Dashboard Dual Grid */
.aligned-table {
  width: 100%;
  border-collapse: collapse;
}

.aligned-table thead tr {
  height: 44px;
}

.aligned-table th {
  height: 44px;
  padding: 0 0.85rem;
  vertical-align: middle;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
  box-sizing: border-box;
}

.aligned-table tbody tr {
  height: 48px;
  box-sizing: border-box;
}

.aligned-table td {
  height: 48px;
  padding: 0 0.85rem;
  vertical-align: middle;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  box-sizing: border-box;
}

.dual-table-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
