:root {
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --accent: #3482f6;      /* HomeChain Blue */
    --accent-hover: #1e59b3;
    --success: #00a186;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --hero-bg: #111827;     /* Dark topographic BG */
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #111827;
        --bg-card: #1f2937;
        --text-main: #f3f4f6;
        --text-muted: #9ca3af;
        --border: #374151;
        --accent: #60a5fa;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-main); color: var(--text-main); font-family: var(--font-sans); font-size: 0.9rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 600; color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }

/* ======== HEADER ======= */
.top-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
}
.navbar {
    background: var(--bg-card);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.nav-container, .container {
    max-width: 1400px; /* Wider like BSCScan */
    margin: 0 auto;
    padding: 0 1rem;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }

.brand { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.brand img { height: 32px; width: auto; }
.brand:hover { text-decoration: none; }

/* Navigation Links & Dropdowns */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.nav-item { position: relative; font-weight: 500; color: var(--text-main); font-size: 0.95rem; cursor: pointer; }
.nav-item a { color: inherit; text-decoration: none; padding: 0.5rem 0; display: inline-flex; align-items: center; gap: 4px; }
.nav-item:hover { color: var(--accent); }

/* Dropdown magic */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
    padding: 0.5rem 0;
}
.nav-item:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    font-size: 0.85rem;
}
.dropdown-menu a:hover { background: rgba(0,0,0,0.03); color: var(--accent); text-decoration: none; }

/* ======== HERO SECTION ======== */
.hero {
    background-color: var(--hero-bg);
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M54.627 0l.83.83v58.34h-58.34l-.83-.83v-58.34h58.34zm-5.463 5.463h-47.414v47.414h47.414v-47.414z" fill="%231f2937" fill-opacity="0.4" fill-rule="evenodd"/%3E%3C/svg%3E');
    padding: 3rem 0;
    padding-bottom: 5.5rem; /* Increased to avoid search box overlap */
    color: white;
    position: relative;
    z-index: 1; /* Lower than stats container */
}
.hero-content { display: flex; justify-content: space-between; align-items: center; gap: 2rem;}
.hero-left { flex: 1; }
.hero-left h1 { font-size: 1.5rem; color: white; margin-bottom: 1rem; font-weight: 500; }

.search-box {
    display: flex;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 0.3rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.search-filter {
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    padding: 0.5rem 1rem;
    color: var(--text-main);
    outline: none;
    font-size: 0.9rem;
    cursor: pointer;
}
.search-filter option {
    background: var(--bg-card);
    color: var(--text-main);
}
.search-input {
    flex: 1;
    border: none;
    padding: 0.5rem 1rem;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
}
.search-btn {
    background: var(--accent);
    border: none;
    color: white;
    padding: 0 1rem;
    border-radius: 6px;
    cursor: pointer;
}
.search-btn:hover { background: var(--accent-hover); }

/* Navbar Search Specifics */
.navbar-search {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    box-shadow: none;
    border: 1px solid var(--border);
}
.navbar-search .search-filter { border-right: 1px solid var(--border); padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.navbar-search .search-input { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.navbar-search .search-btn { padding: 0 0.75rem; border-radius: 4px; }

/* Clear Button (X) */
.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
}
.clear-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }
.clear-btn svg { width: 14px; height: 14px; }

.hero-ad {
    background: #000000; /* Solid Black as requested */
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1rem;
    min-width: 320px;
    text-align: center;
}
.hero-ad img { max-width: 100%; height: auto; display: block; border-radius: 4px; margin:0 auto; }

/* ======== STATS BANNER 3.0 FIX ======== */
.stats-container {
    position: relative;
    z-index: 10; /* Hoist the entire container above the hero siblings */
}

.stats-banner {
    background-color: var(--bg-card); /* Typo fix: Changed from --card-bg to --bg-card */
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    margin: 0;
    transform: translateY(-50px);
    margin-bottom: -20px; 
    position: relative;
    z-index: 20; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensure inner content doesn't bleed out of radius */
}

.stats-row {
    display: flex;
    padding: 1.25rem 1.5rem;
}

.stats-row.border-top {
    border-top: 1px solid var(--border);
}

.stat-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-col.divider-left {
    border-left: 1px solid var(--border);
    padding-left: 1.5rem;
}

.stat-block {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    background: rgba(52, 130, 246, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.stat-icon img { filter: none !important; }

.stat-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.chart-container {
    height: 80px;
    width: 100%;
}

.text-secondary {
    color: #10b981 !important; /* BSCScan Green */
}

/* ======== CARDS & GRIDS ======== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-sm {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-main);
    cursor: pointer;
}
.btn-sm:hover { background: rgba(0,0,0,0.02); }

/* Table overrides to look like BSCScan blocks/txs list */
.list-table {
    width: 100%;
    border-collapse: collapse;
}
.list-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.list-table tr:last-child td { border-bottom: none; }

.identicon-box {
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}
.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    background: rgba(0,0,0,0.01);
}
.card-footer a { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; font-weight: 500;}

/* STANDARD TABLES */
.table-responsive { overflow-x: auto; }
table.standard { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.standard th { text-align:left; padding:0.75rem 1rem; border-bottom:1px solid var(--border); background:rgba(0,0,0,0.02); font-weight:600; color:var(--text-main); }
table.standard td { padding:0.75rem 1rem; border-bottom:1px solid var(--border); }

/* Helpers */
.badge { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; display: inline-block; font-weight: 600; }
.badge-outline { border: 1px solid var(--border); color: var(--text-main); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: #fff3cd; color: #856404; }

.truncate-hash {
    display: inline-block; max-width: 150px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;
}

/* ======== FOOTER ======== */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: 3rem 0;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
}
.footer-title { font-weight: 600; margin-bottom: 1rem; font-size: 0.95rem; }
.footer-list { list-style: none; }
.footer-list li { margin-bottom: 0.5rem; }
.footer-list a { color: var(--text-muted); font-size: 0.85rem; }
.footer-list a:hover { color: var(--accent); }
.footer-brand img { width: 24px; filter: grayscale(1); margin-bottom:1rem; }
.footer-bottom { 
    border-top: 1px solid var(--border); 
    padding-top: 1.5rem; 
    margin-top: 2rem; 
    display: flex; 
    justify-content: space-between; 
    color: var(--text-muted); 
    font-size: 0.85rem; 
}
