:root {
    --primary-color: #2563eb;
    --secondary-color: #475569;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.dashboard-header {
    background-color: var(--surface-color);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.dashboard-main {
    flex: 1;
    position: relative;
}

.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-overlay-controls {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000; /* Above Leaflet controls */
    width: 300px;
}

.control-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-card h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.layer-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.radio-container:hover {
    background-color: #f1f5f9;
}

.radio-container input {
    display: none;
}

.radio-checkmark {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.radio-container input:checked + .radio-checkmark {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.radio-container input:checked + .radio-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
    height: 0.5rem;
    background-color: white;
    border-radius: 50%;
}

.label-text {
    font-weight: 500;
    color: var(--text-primary);
}

.legend-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    margin-right: 0.75rem;
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.5;
}

.popup-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.popup-body {
    padding: 1rem;
}

.popup-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.popup-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.popup-value {
    font-weight: 600;
    color: var(--text-primary);
}
