:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Navbar */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-brand .subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Status Banner */
.status-banner {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.connection-info code {
    background: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.chart-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chart-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.chart-card {
    position: relative;
}

.chart-container {
    position: relative;
    height: 300px !important;
    max-height: 300px !important;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-card canvas {
    max-height: 300px !important;
    height: 300px !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

#hashrateChart, #workersChart {
    max-height: 300px !important;
    height: 300px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Workers Section */
.workers-section, .blocks-section, .payments-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.workers-section h2, .blocks-section h2, .payments-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.table-container {
    overflow-x: auto;
}

.workers-table, .payments-table {
    width: 100%;
    border-collapse: collapse;
}

.workers-table th, .payments-table th {
    text-align: left;
    padding: 1rem;
    background: var(--bg-dark);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.workers-table td, .payments-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.workers-table tr:hover, .payments-table tr:hover {
    background: var(--bg-dark);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Blocks Grid */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.block-card {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.block-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.block-height {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.block-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Payments Section */
.payment-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.payment-card {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.payment-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.payment-info, .wallet-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.wallet-address {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    word-break: break-all;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.wallet-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.recent-payments {
    margin-top: 2rem;
}

/* Mining Guide */
.mining-guide {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.mining-guide h2 {
    margin-bottom: 2rem;
    text-align: center;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.guide-step {
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.guide-step h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.guide-step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.guide-step code {
    background: var(--bg-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s;
}

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

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .status-banner {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

