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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#chart {
    width: 100vw;
    height: 100vh;
}

svg {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #fafafa;
    cursor: grab;
}

svg:active {
    cursor: grabbing;
}

.node {
    cursor: pointer;
    transition: stroke-width 0.2s ease;
}

.node:hover {
    stroke-width: 3px !important;
    stroke: #333 !important;
}

.link {
    pointer-events: none;
}

.legend {
    pointer-events: none;
    user-select: none;
}

.legend text {
    fill: #333;
}

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

.tooltip strong {
    color: #ffd700;
    display: block;
    margin-bottom: 4px;
}

/* Controls overlay */
.controls-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    backdrop-filter: blur(5px);
    border: none;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.control-item:last-child {
    margin-bottom: 0;
}

.control-item label {
    font-size: 12px;
    color: #000;
    font-weight: bold;
    text-transform: uppercase;
}

.control-item #repulsion-value {
    color: #000;
    font-weight: bold;
}

.control-item input[type="range"] {
    width: 200px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #000;
    outline: none;
    border-radius: 0;
}

.control-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #000;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.2s;
}

.control-item input[type="range"]::-webkit-slider-thumb:hover {
    background: #333;
}

.control-item input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #000;
    cursor: pointer;
    border-radius: 0;
    border: none;
    transition: background 0.2s;
}

.control-item input[type="range"]::-moz-range-thumb:hover {
    background: #333;
}

/* Checkbox styling */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

.checkbox-item input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

/* Radio button styling */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.radio-item input[type="radio"] {
    display: none; /* Hide the radio buttons */
}

.radio-item label {
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: #000;
    padding: 3px 6px;
    border: 2px solid transparent;
}

/* Metric section - black text and black background when selected */
.metric-group .radio-item label {
    color: #000;
}

.metric-group .radio-item input[type="radio"]:checked + label {
    background-color: #000;
    border-color: #000;
    color: white;
}

.radio-item input[type="radio"]:checked + label {
    background-color: #333;
    border-color: #333;
    color: white;
}

/* Node labels */
.node-label {
    /* Text shadow is set dynamically based on borough color */
    text-transform: uppercase;
    font-weight: bold;
}
