/* =========================================
   marker.css : 지도 마커 및 클러스터, 지역 버튼
   ========================================= */
.marker-container-icon { overflow: visible !important; }
.custom-combined-marker {
    --marker-size: 22px;
    --marker-color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    pointer-events: auto;
    cursor: pointer;
    width: 0;
    height: 0;
}

/* 기본 기호 마커 */
.marker-symbol {
    width: var(--marker-size);
    height: var(--marker-size);
    font-size: 0;
    line-height: 1;
    z-index: 12;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--marker-color);
    background: transparent;
    border: 0;
    box-shadow: none;
    filter: none;
    transform: translate(-50%, -50%);
    text-shadow: none;
    transition: transform 0.12s ease, background 0.12s ease;
}
.marker-svg {
    width: 22px;
    height: 22px;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 2px 3px rgba(15,23,42,0.24));
}
.marker-core {
    fill: currentColor;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}
.marker-window {
    fill: #ffffff;
    stroke: none;
}
.custom-combined-marker:hover .marker-symbol {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: none;
}

/* 기본 이름표(라벨) */
.marker-label-box {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    color: #172033;
    font-size: 10.5px;
    font-weight: 850;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid rgba(148,163,184,0.45);
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(15,23,42,0.14);
    border-left-width: 3px;
    border-left-style: solid;
    z-index: 300;
    bottom: 20px;
    left: 50%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(5px);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out, visibility 0.15s;
    pointer-events: auto;
    cursor: pointer;
}
.marker-label-box.label-bottom { bottom: auto; top: 26px; transform: translateX(-50%) translateY(-5px); }
.view-labels-mode .marker-label-box { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* 같은 좌표의 학교/유치원은 아이콘만 아주 살짝 겹쳐 보이게 합니다. */
.marker-stack-badge {
    position: absolute;
    left: 8px;
    top: -20px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(15,23,42,0.24);
    font-size: 10px;
    font-weight: 900;
    line-height: 14px;
    text-align: center;
    box-sizing: border-box;
    z-index: 20;
    pointer-events: none;
}

/* 겹침(Stack) 시 위치는 같은 장소로 보이도록 1~2px만 미세 조정합니다. */
.stack-pos-0 .marker-symbol { left: -1.5px; top: -1.5px; }
.stack-pos-1 .marker-symbol { left: 1.5px; top: 1.5px; }
.stack-pos-2 .marker-symbol { left: -2px; top: 1px; }
.stack-pos-3 .marker-symbol { left: 2px; top: -1px; }
.stack-pos-4 .marker-symbol { left: 0; top: -2px; }
.stack-pos-5 .marker-symbol { left: 2px; top: 0; }
.stack-pos-6 .marker-symbol { left: 0; top: 2px; }
.stack-pos-7 .marker-symbol { left: -2px; top: 0; }
.has-stack .marker-label-box { bottom: 24px; }
.stack-pos-0 .marker-label-box { left: calc(50% - 1.5px); bottom: 26px; }
.stack-pos-1 .marker-label-box { left: calc(50% + 1.5px); bottom: auto; top: 26px; transform: translateX(-50%) translateY(-5px); }
.stack-pos-2 .marker-label-box { left: calc(50% - 2px); bottom: 26px; }
.stack-pos-3 .marker-label-box { left: calc(50% + 2px); bottom: auto; top: 26px; transform: translateX(-50%) translateY(-5px); }
.stack-pos-4 .marker-label-box { bottom: 27px; }
.stack-pos-5 .marker-label-box { left: calc(50% + 2px); bottom: auto; top: 26px; transform: translateX(-50%) translateY(-5px); }
.stack-pos-6 .marker-label-box { bottom: 24px; }
.stack-pos-7 .marker-label-box { left: calc(50% - 2px); bottom: auto; top: 26px; transform: translateX(-50%) translateY(-5px); }
.view-labels-mode .stack-pos-1 .marker-label-box,
.view-labels-mode .stack-pos-3 .marker-label-box,
.view-labels-mode .stack-pos-5 .marker-label-box,
.view-labels-mode .stack-pos-7 .marker-label-box {
    transform: translateX(-50%) translateY(0);
}

#map.cursor-crosshair .custom-combined-marker { cursor: crosshair; }
#map.cursor-crosshair .custom-combined-marker:hover .marker-symbol {
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 0 3px rgba(231,76,60,0.45)) drop-shadow(0 2px 3px rgba(15,23,42,0.24));
}

/* 타입별 이름표 좌측 테두리 색상 */
.is-kinder .marker-label-box { border-left-color: #4A90E2; }
.is-elem .marker-label-box { border-left-color: #2ECC71; }
.is-mid .marker-label-box { border-left-color: #F1C40F; }
.is-high .marker-label-box { border-left-color: #E74C3C; }
.is-spec .marker-label-box { border-left-color: #9B59B6; }
.is-edu .marker-label-box { border-left-color: #0d47a1; }
.is-shared .marker-label-box { border-left-color: #e84393; }

/* 원형 클러스터 (묶음) 마커 */
.marker-cluster div { width: 30px; height: 30px; margin-left: 5px; margin-top: 5px; text-align: center; border-radius: 15px; font-weight: 900; color: #fff !important; display: flex; align-items: center; justify-content: center; }
.marker-cluster-small { background-color: rgba(160, 200, 120, 0.4) !important; }
.marker-cluster-small div { background-color: rgba(120, 170, 80, 0.7) !important; }
.marker-cluster-yellow { background-color: rgba(241, 211, 87, 0.4) !important; }
.marker-cluster-yellow div { background-color: rgba(240, 194, 12, 0.7) !important; }
.marker-cluster-red { background-color: rgba(233, 92, 46, 0.4) !important; }
.marker-cluster-red div { background-color: rgba(214, 40, 40, 0.7) !important; }

/* --- 행정구역 통계 플로팅 버튼 (입체 3D 버튼) --- */
.leaflet-container .dist-stat-btn {
    color: #ffffff !important;
    border-radius: 10px !important;
    padding: 10px 16px !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 24px rgba(15,23,42,0.2) !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    cursor: pointer !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.24) !important;
    min-width: 90px !important;
    transition: transform var(--motion-fast, 0.18s ease), box-shadow var(--motion-fast, 0.18s ease), filter var(--motion-fast, 0.18s ease) !important;
    z-index: 500 !important;
}
.leaflet-container .dist-stat-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 14px 30px rgba(15,23,42,0.24) !important;
    filter: brightness(1.04) !important;
}

/* 쫀득하게 눌리는 이펙트 */
.leaflet-container .dist-stat-btn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 6px 14px rgba(15,23,42,0.2) !important;
}
.leaflet-container .dist-stat-label {
    font-weight: 900 !important;
    font-size: 14.5px !important;
    letter-spacing: -0.5px !important;
    color: #ffffff !important;
}

/* --- 지도 축소/확대 시 크기 조절 및 저배율 투명도 적용 --- */
.district-stat-marker .zoom-lv-10 { display: none !important; }

/* 👇 저배율 (11~12레벨): 처음 켰을 때 너무 안 보이지 않도록 투명도 상향 (0.4 -> 0.75 / 0.7 -> 0.9) 👇 */
.district-stat-marker .zoom-lv-11 { opacity: 0.65 !important; }
.district-stat-marker .zoom-lv-11 .dist-stat-btn { padding: 6px 10px !important; min-width: 65px !important; }
.district-stat-marker .zoom-lv-11 .dist-stat-label { font-size: 12px !important; }
.district-stat-marker .zoom-lv-11 .shared-dist-img { width: 18px !important; height: 18px !important; }

.district-stat-marker .zoom-lv-12 { opacity: 0.75 !important; }
.district-stat-marker .zoom-lv-12 .dist-stat-btn { padding: 8px 12px !important; min-width: 75px !important; }
.district-stat-marker .zoom-lv-12 .dist-stat-label { font-size: 13.5px !important; }
.district-stat-marker .zoom-lv-12 .shared-dist-img { width: 21px !important; height: 21px !important; }

/* 고배율 (13레벨 이상): 불투명도 100% 및 원본 크기 유지 */
.district-stat-marker .zoom-lv-13 { opacity: 0.85 !important; }
.district-stat-marker .zoom-lv-14, 
.district-stat-marker .zoom-lv-15, 
.district-stat-marker .zoom-lv-16, 
.district-stat-marker .zoom-lv-17, 
.district-stat-marker .zoom-lv-18 { opacity: 1 !important; }
