body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

#header {
    text-align: center;
    margin-bottom: 20px;
}

#header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
}

#header h2 {
    color: #34495e;
    margin: 5px 0 20px 0;
    font-weight: normal;
    font-size: 1.2em;
}

#controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

#controls label {
    font-weight: bold;
    color: #2c3e50;
}

#controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

#controls select:hover {
    border-color: #3498db;
}

#map-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#map {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.county {
    stroke: #fff;
    stroke-width: 0.5px;
    cursor: pointer;
}

.county:hover {
    stroke: #333;
    stroke-width: 2px;
}

.state-border {
    fill: none;
    stroke: #666;
    stroke-width: 1px;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
}

#tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    max-width: 250px;
    line-height: 1.5;
    z-index: 1000;
}

#tooltip strong {
    font-size: 14px;
}

#tooltip small {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

#legend {
    text-align: center;
    margin: 20px 0;
}

#legend h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

#legend-scale {
    display: inline-block;
    height: 50px;
    width: 300px;
}

#legend-scale svg {
    border-radius: 4px;
    overflow: visible;
}

#info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#info p {
    margin: 10px 0;
}

#summary {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    text-align: left;
}

#summary p {
    margin: 8px 0;
}

#summary span {
    font-weight: bold;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #header h1 {
        font-size: 2em;
    }

    #controls {
        flex-direction: column;
        gap: 15px;
    }

    .control-group {
        flex-direction: column;
        gap: 5px;
    }

    #map {
        width: 100%;
        height: auto;
    }

    #legend-scale {
        width: 250px;
    }
}
