/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2.5rem 0;
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.data-status {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.status-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.update-available {
    background: var(--warning-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Navigation Tabs */
.nav-tabs {
    background: white;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-tabs .container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 1.5rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.section-description {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.2s;
}

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

.stat-card.highlight {
    border-left: 4px solid var(--primary-color);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

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

.stat-value.success {
    color: var(--success-color);
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-sublabel {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.stat-date {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Charts */
.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.chart-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

canvas {
    max-height: 400px;
}

/* Insight Boxes */
.insight-box {
    background: linear-gradient(135deg, #eff6ff 0%, #f3f4f6 100%);
    padding: 2rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 2rem;
}

.insight-box h4 {
    margin-bottom: 1rem;
}

.insight-box ul {
    list-style: none;
    padding: 0;
}

.insight-box li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.insight-box li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

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

.implication-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--primary-color);
}

.implication-card h5 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.implication-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

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

/* County Details */
.county-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.county-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.county-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

.county-stat:last-child {
    border-bottom: none;
}

.county-stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

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

/* Insights Container */
.insights-container {
    display: grid;
    gap: 2rem;
}

.insight-card.featured {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--primary-color);
}

.insight-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.insight-card.featured ul {
    list-style: none;
    padding: 0;
}

.insight-card.featured li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.insight-card.featured li:last-child {
    border-bottom: none;
}

.insight-card.featured li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Data Notes */
.data-note {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-top: 2rem;
    font-size: 0.95rem;
}

.data-note strong {
    color: var(--warning-color);
}

.data-note a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 0.75rem;
    text-align: center;
    margin-top: 3rem;
}

.cta-box h3 {
    color: white;
    margin-bottom: 1rem;
}

.cta-box p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: scale(1.05);
}

.cta-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

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

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

.loading.hidden {
    display: none;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

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

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

.data-current {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    color: var(--warning-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

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

    .nav-tabs .container {
        padding: 0.5rem 1rem;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .chart-container {
        padding: 1.5rem;
    }

    canvas {
        max-height: 300px;
    }

    .implication-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}
