/* /resources/css/gis/gis-panel.css */
/*
 * 예측지도 — 지도 표시 설정 패널 · 안전지수 범례 · 급식시설 카드 (gis-core.js · gis-feature.js)
 * 출처: vworld-demo static/css/style.css 를 기능별로 나눈 것. 규칙 본문은 원본 그대로이고,
 * FRPS 에서 고친 곳은 "FRPS 보정" 주석을 단다.
 */

.map-settings {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
}

.map-settings-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.map-settings-toggle:hover {
    background: #1d4ed8;
}

.map-settings-panel {
    position: absolute;
    top: 42px;
    left: 0;
    width: 300px;

    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 16px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.panel-title {
    font-weight: 600;
    font-size: 14px;
}

.panel-close {
    border: none;
    background: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.panel-row {
    margin-bottom: 14px;
}

.panel-row:last-child {
    margin-bottom: 0;
}

.panel-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.panel-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.button-group {
    display: flex;
    gap: 6px;
}

.button-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.button-group label {
    flex: 1;
    text-align: center;
    padding: 7px 0;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.button-group input[type="radio"]:checked + label {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* FRPS 보정 — 비활성 묶음(지역경계 "기본"일 때 지도유형·통계표출). 눌러도 선택되지 않고 회색으로 보인다.
 * 켜져 있던 값은 옅은 회색 채움으로 남겨 두어, 다른 경계 모드로 돌아가면 어떤 값이 살아나는지 알 수 있게 한다 */
.button-group input[type="radio"]:disabled + label {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #b0b9c6;
    cursor: not-allowed;
}

.button-group input[type="radio"]:checked:disabled + label {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.safety-legend {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900; /* .map-settings(1000)보단 아래, 지도 타일보단 위 */

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);

    font-size: 13px;
    white-space: nowrap;
}

.safety-legend-title {
    font-weight: 600;
    color: #1f2430;
    padding-right: 6px;
    border-right: 1px solid #e2e8f0;
}

.safety-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1f2430;
}

.safety-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.safety-legend-range {
    color: #94a3b8;
    font-size: 12px;
}

.safety-legend-nationwide {
    padding-left: 10px;
    border-left: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
    white-space: nowrap;
}

/* 급식시설 표시: 업태별 아이콘 카드 토글.
 * 실제 <input type="checkbox">는 그대로 두고(facilityToggleAll / facilityTypeCheckbox —
 * gis-feature.js의 initFacilityControls()가 그대로 참조) 시각적으로만 숨긴 뒤,
 * 옆의 .facility-card-body를 인접 형제 선택자(:checked +)로 스타일링한다.
 * 카드마다 style="--c:#..."로 지정한 색은 gis-feature.js의 FACILITY_TYPE_COLORS
 * (지도 마커 색)와 동일해야 한다 — 패널에서 고른 색이 지도 위 마커 색으로 그대로 이어짐. */
.facility-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.facility-card {
    cursor: pointer;
    display: block;
}

.facility-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.facility-card-body {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #fafafa;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
    user-select: none;
}

/* 지도 마커(gis-feature.js의 지도핀 SVG)와 모양을 맞춘 "물방울 핀" 아이콘.
 * border-radius로 눈물방울을 만들고 45도 회전시키는 CSS 트릭이라, 안의 글리프는
 * 반대로 45도 되돌려 회전시켜야 똑바로 보인다(.facility-card-icon .glyph). */
.facility-card-icon {
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background: var(--c, #94a3b8);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.facility-card-icon .glyph {
    transform: rotate(45deg);
    line-height: 1;
}

.facility-card input:checked + .facility-card-body {
    border-color: var(--c, #2563eb);
    background: color-mix(in srgb, var(--c, #2563eb) 14%, white);
    color: var(--c, #2563eb);
}

.facility-card-all {
    grid-column: 1 / -1;
}

.facility-card-all .facility-card-body {
    justify-content: center;
    font-weight: 700;
    background: #f1f5f9;
    border-style: dashed;
}

.facility-card-all .facility-card-icon {
    background: #94a3b8;
}

.facility-card-all input:checked + .facility-card-body {
    border-color: #2563eb;
    background: color-mix(in srgb, #2563eb 14%, white);
    color: #2563eb;
}

/* FRPS 보정 (project map-layout.css) — 설정 패널이 지도 높이를 넘으면 패널 안에서 스크롤한다.
 * .map-settings 를 지도 아래 끝(bottom:15px)까지 늘려야 패널의 max-height(%)가 지도 높이 기준이 된다.
 * 늘어난 빈 영역이 지도 클릭을 막지 않게 틀은 클릭을 통과시키고, 버튼·패널만 클릭을 받는다 */
.prediction-map-page .map-settings {
    bottom: 15px;
    pointer-events: none;
}

.prediction-map-page .map-settings-toggle,
.prediction-map-page .map-settings-panel {
    pointer-events: auto;
}

.prediction-map-page .map-settings-panel {
    max-height: calc(100% - 42px);
    overflow-y: auto;
}
