:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

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

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

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

/* Header */
.header {
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error-message {
    background: #7f1d1d;
    border: 1px solid #dc2626;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

/* Counters Grid */
.counters-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    padding: 2rem 0;
}

.counter-card {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.counter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px -10px var(--accent-color, #3b82f6);
    border-color: var(--accent-color, #3b82f6);
}

.counter-card.selected {
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 0 0 1px var(--accent-color, #3b82f6), 0 8px 30px -10px var(--accent-color, #3b82f6);
}

.counter-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.counter-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-color, #3b82f6);
    margin-bottom: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.counter-label {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.counter-source {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Charts Section */
.charts-section {
    padding: 2rem 0 4rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn:hover {
    border-color: #3b82f6;
}

.btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
}

.chart-container {
    height: 400px;
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

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

.footer a {
    color: #3b82f6;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-links {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #3b82f6;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.social-links a:hover {
    color: #3b82f6;
}

.footer p {
    margin: 0.25rem 0;
}

/* Responsive */
@media (max-width: 900px) {
    .counters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .counter-value {
        font-size: 1.35rem;
    }

    .chart-container {
        height: 300px;
        padding: 1rem;
    }

    .counters-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 1.5rem 0;
    }
}
