/* Unified Typography & Responsive Layout */
:root {
    --primary-red: #7f0000;
    --text-main: #333333;
    --text-muted: #666666;
    --bg-light: #f9f9f9;
    --border-color: #cccccc;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
}

/* Responsive Margins & Container */
main, header, .footer-container {
    width: 92%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

header {
    padding: 40px 0 20px;
    text-align: center;
}

header h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 20px;
    text-align: center;
}

/* Alert Bar Typography */
.outbreak-alert-bar {
    background-color: var(--primary-red);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    margin: 10px auto 30px;
}

/* Dashboard Cards Typography */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.hotspot-card {
    background: var(--bg-light);
    border-left: 5px solid var(--primary-red);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hotspot-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.hotspot-card .count {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Map Layout */
#map-parent {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
    overflow: hidden;
    padding: 20px;
}

#map-container {
    position: relative;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    touch-action: none; /* Disable native touch actions for custom pan/zoom */
}

#us-map {
    max-width: 100%;
    cursor: grab;
}

#us-map:active {
    cursor: grabbing;
}

.info-window {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    pointer-events: auto; /* Enable clicks inside the window */
}

.map-legend {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: inline-block;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.legend-item .box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Data Table Typography */
#data-container {
    margin-top: 20px;
    overflow-x: auto;
}

#data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#data-table th {
    background-color: #f0f0f0;
    padding: 15px;
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

#data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

#data-table tr:hover {
    background-color: #fcfcfc;
}

/* Zoom Controls */
#zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
}

#zoom-controls button {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Footer Typography */
.footer-container {
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* SVG Pulse */
@keyframes pulse-red {
    0% { fill-opacity: 0.5; }
    50% { fill-opacity: 1; }
    100% { fill-opacity: 0.5; }
}
.pulse-active {
    animation: pulse-red 2s infinite ease-in-out !important;
}
