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

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

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

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

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

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-dark);
    border-radius: 20px;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--accent-red);
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Connection Banner */
.connection-banner {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #3b82f6;
}

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

.banner-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.banner-content {
    display: grid;
    gap: 15px;
}

.connection-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.connection-item label {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
}

.copy-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.copy-field code {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}

.copy-field button {
    background: var(--accent-green);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.copy-field button:hover {
    background: #059669;
    transform: translateY(-1px);
}

.copy-field small {
    opacity: 0.7;
    font-size: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

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

.stat-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.stat-value-small {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

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

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.refresh-indicator {
    font-size: 12px;
    color: var(--text-secondary);
}

.card-content {
    color: var(--text-secondary);
}

/* Sync Status */
.sync-status {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sync-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sync-percentage {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 6px;
}

.sync-details {
    font-size: 13px;
    opacity: 0.8;
}

/* Miners List */
.miners-list {
    display: grid;
    gap: 12px;
}

.miner-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    transition: all 0.2s;
}

.miner-card:hover {
    border-color: var(--accent-blue);
}

.miner-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-green);
}

.miner-status.offline {
    background: var(--accent-red);
}

.miner-info h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.miner-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.miner-hashrate {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-blue);
    text-align: right;
}

/* Blocks List */
.blocks-list {
    display: grid;
    gap: 12px;
}

.block-card {
    background: linear-gradient(135deg, #065f46, #047857);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--accent-green);
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.block-height {
    font-size: 18px;
    font-weight: 700;
}

.block-time {
    font-size: 13px;
    opacity: 0.8;
}

.block-hash {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    opacity: 0.7;
    word-break: break-all;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state small {
    font-size: 13px;
    opacity: 0.7;
}

/* Chart */
#hashrate-chart {
    max-height: 300px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer p {
    margin-bottom: 5px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-value-small {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .miner-card {
        grid-template-columns: auto 1fr;
        gap: 10px;
    }

    .miner-hashrate {
        grid-column: 2;
        text-align: left;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-value-small {
        font-size: 20px;
    }

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

/* Wide Miner Cards */
.miner-card-wide {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.miner-card-wide:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

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

.miner-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.miner-name h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.miner-hashrate-large {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-blue);
}

.miner-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.miner-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.miner-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

@media (max-width: 768px) {
    .miner-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .miner-hashrate-large {
        font-size: 20px;
    }
}