/* BrainArk Explorer - BSCScan/Etherscan Style CSS */

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

:root {
    --primary-color: #0784c3;
    --secondary-color: #6366f1;
    --success-color: #00c9a7;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --text-primary: #1e2022;
    --text-secondary: #6c757d;
    --text-muted: #9a9fa5;
    --border-color: #e7eaf3;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    height: 32px;
    width: 32px;
}

.logo-section h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 50px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 132, 195, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #0668a1;
}

/* Header Stats */
.header-stats {
    display: flex;
    gap: 20px;
    font-size: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-muted);
    font-size: 11px;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    padding: 24px 0;
}

/* Stats Banner */
.stats-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 32px;
}

.stat-info {
    flex: 1;
}

.stat-info .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-info .stat-value {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
}

/* Tables */
.tables-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

.table-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.table-card {
    padding: 0;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.table-row:hover {
    background: var(--bg-light);
}

.table-row:last-child {
    border-bottom: none;
}

.row-left, .row-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.row-label {
    color: var(--text-muted);
    font-size: 12px;
}

.row-value {
    color: var(--text-primary);
    font-weight: 500;
}

.row-link {
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Courier New', monospace;
}

.row-link:hover {
    text-decoration: underline;
}

/* Detail Page */
.detail-page {
    padding: 24px 0;
}

.detail-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.detail-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.detail-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    color: var(--text-primary);
    word-break: break-all;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

/* Copy Button */
.copy-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
}

.copy-btn:hover {
    color: #0668a1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    margin-top: 48px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.footer-section h3, .footer-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.footer-section p, .footer-section a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-white);
    padding: 16px 24px;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success-color);
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.error {
    border-left-color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    .tables-container {
        grid-template-columns: 1fr;
    }

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

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        max-width: 100%;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Additional styles for Network Stats and Token Holders pages */
.header-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.header-nav a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.header-nav a.active {
    background: var(--primary-color);
    color: white;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #0668a1;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card-large {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-card-large .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-large .stat-change {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.chart-container {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-container h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.chart {
    min-height: 300px;
    padding: 20px 0;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    gap: 2px;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 3px 3px 0 0;
    transition: opacity 0.2s;
    cursor: pointer;
    min-height: 2px;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 6px;
    white-space: nowrap;
    transform: rotate(-45deg);
    transform-origin: top left;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-light);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tr:hover {
    background: var(--bg-light);
}

.hash-link {
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.hash-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header-nav {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-label {
        font-size: 8px;
    }
}
