/* Living Local Lab - Professional Dashboard Styles */

:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8a;
    --secondary: #4a90a4;
    --accent: #e8f4f8;
    --success: #2e7d32;
    --warning: #f57c00;
    --danger: #c62828;
    --neutral: #546e7a;
    --text: #263238;
    --text-light: #607d8b;
    --bg: #f5f7fa;
    --white: #ffffff;
    --border: #cfd8dc;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 2rem 1rem;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Intro Section */
.intro {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary);
    box-shadow: 0 2px 4px var(--shadow);
}

.intro p {
    font-size: 1.05rem;
    color: var(--text);
    max-width: 900px;
}

/* County Selector */
.county-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.county-selector label {
    font-weight: 600;
    color: var(--primary);
}

.county-selector select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.2s;
}

.county-selector select:hover,
.county-selector select:focus {
    border-color: var(--secondary);
    outline: none;
}

.last-updated {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Dashboard Sections */
.dashboard {
    animation: fadeIn 0.3s ease;
}

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

.dashboard h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

/* Vitals Grid - Overview Charts */
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vital-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.vital-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow);
}

.vital-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.vital-card .description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* Summary Table */
.summary-section {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    overflow-x: auto;
}

.summary-section h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.summary-table th {
    background: var(--accent);
    color: var(--primary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border);
}

.summary-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.summary-table tbody tr:hover {
    background: var(--accent);
}

.summary-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

/* Status Badges */
.status-stable {
    background: var(--success);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-caution {
    background: var(--warning);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-stress {
    background: var(--danger);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

/* County Detail View */
.county-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-box {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Detail Cards */
.vitals-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vital-detail-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.vital-detail-card h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

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

.metric-row:last-of-type {
    border-bottom: none;
}

.metric-row.highlight {
    background: var(--accent);
    margin: 0 -1rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.metric-label {
    color: var(--text-light);
}

.metric-value {
    font-weight: 600;
    color: var(--text);
}

.metric-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 1rem;
    font-style: italic;
}

/* Value Colors */
.value-good { color: var(--success); }
.value-caution { color: var(--warning); }
.value-bad { color: var(--danger); }

/* Back Button */
.back-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--primary-light);
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--white);
    margin-top: 4rem;
    padding: 3rem 1rem 1rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

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

.footer-section li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

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

.footer-section p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.6;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-bottom a {
    color: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.75rem;
    }
    
    .county-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .last-updated {
        margin-left: 0;
    }
    
    .county-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-box {
        width: 100%;
    }
    
    .vitals-grid,
    .vitals-detail {
        grid-template-columns: 1fr;
    }
}
