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

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #1F2937;
    --light: #F9FAFB;
    --gray: #6B7280;
    --gray-light: #9CA3AF;
    --border: #E5E7EB;
    --bg-card: #FFFFFF;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gradient: linear-gradient(135deg, #6366F1, #8B5CF6);
}

[data-theme="dark"] {
    --light: #111827;
    --dark: #F9FAFB;
    --bg-card: #1F2937;
    --border: #374151;
    --gray: #9CA3AF;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    transition: all 0.3s ease;
}

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

/* Header */
.header {
    background: var(--gradient);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.network-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Search */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    width: 300px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
}

.search-box button {
    position: absolute;
    right: 5px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    color: white;
    cursor: pointer;
}

/* Wallet */
.wallet-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-wallet {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-wallet:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: white;
    font-family: monospace;
}

.btn-disconnect {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
}

.admin-badge {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

/* Stats Section */
.stats-section {
    margin-bottom: 2rem;
}

.stats-section h2 {
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Controls */
.controls-section {
    margin-bottom: 2rem;
}

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

.btn-control {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.btn-control:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-control.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.admin-btn {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Content Section */
.content-section {
    margin-bottom: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.content-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--dark);
    font-size: 1.25rem;
}

.card-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-nav, .btn-view-all {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-nav:hover, .btn-view-all:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Lists */
.blocks-list, .transactions-list {
    max-height: 400px;
    overflow-y: auto;
}

.block-item, .transaction-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.3s ease;
}

.block-item:hover, .transaction-item:hover {
    background: #f8fafc;
}

.block-item:last-child, .transaction-item:last-child {
    border-bottom: none;
}

.block-number {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.block-hash {
    font-family: 'Courier New', monospace;
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.block-info {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 0.85rem;
}

.tx-hash {
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tx-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray);
    font-size: 0.85rem;
}

.tx-value {
    color: var(--secondary);
    font-weight: 600;
}

.tx-status {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tx-status.success {
    background: #D1FAE5;
    color: #065F46;
}

.tx-status.pending {
    background: #FEF3C7;
    color: #92400E;
}

/* Charts */
.charts-section {
    margin-bottom: 2rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
}

.chart-container {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    margin-top: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

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

.detail-value {
    font-family: 'Courier New', monospace;
    word-break: break-all;
    text-align: right;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

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

.notification.success {
    background: var(--secondary);
}

.notification.error {
    background: var(--danger);
}

.notification.info {
    background: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-controls {
        justify-content: center;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .card-controls {
        width: 100%;
        justify-content: space-between;
    }
}
