/* 부산 지도 모달 전용 스타일 */
.busan-map-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.busan-map-modal.active {
    display: flex;
    opacity: 1;
}

.busan-map-container {
    width: 90%;
    max-width: 800px;
    height: 80vh;
    background: #fff;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.busan-map-header {
    padding: 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.busan-map-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
    font-weight: 700;
}

.busan-map-header .back-to-busan {
    display: none;
    padding: 6px 12px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.busan-map-header .close-map-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
}

.busan-map-body {
    flex: 1;
    position: relative;
    background: #e0f2fe; /* Light blue representing ocean background */
    cursor: grab;
}

.busan-map-body:active {
    cursor: grabbing;
}

/* D3.js SVG Styles */
.dong-path {
    fill: #f1f5f9;
    stroke: #94a3b8;
    stroke-width: 0.5px;
    transition: fill 0.3s;
    cursor: pointer;
}

.dong-path:hover {
    fill: #bae6fd;
}

.dong-path.selected-gu {
    fill: #38bdf8;
    stroke: #0284c7;
    stroke-width: 1px;
}

.dong-path.selected-dong {
    fill: #1d4ed8;
    stroke: #fff;
    stroke-width: 1.5px;
}

.dong-path.faded {
    fill: #f8fafc;
    stroke: #cbd5e1;
    opacity: 0.5;
}

.gu-label {
    fill: #0f172a;
    font-size: 11px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
    text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

.dong-label {
    fill: #0f172a;
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.7), -1px 1px 0 rgba(255,255,255,0.7), 1px -1px 0 rgba(255,255,255,0.7), -1px -1px 0 rgba(255,255,255,0.7);
}

/* 호버되거나 클릭된 동은 텍스트가 뜹니다 */
.dong-label.hover-dong, .dong-label.visible-dong {
    opacity: 1 !important;
}

/* 지도가 글씨가 안 겹칠 만큼 줌 확대되었을 경우 전체 동 라벨 노출 */
.busan-map-body.show-all-dongs .dong-label {
    opacity: 1 !important;
}

/* 동 레벨로 들어갔을 때 구 라벨 숨기기 */
.zoomed-in .gu-label {
    display: none;
}

/* 도움말 툴팁 */
.map-tooltip {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

/* 반응형 모바일 스타일 */
@media (max-width: 768px) {
    .busan-map-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .busan-map-header {
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .busan-map-header h2 {
        font-size: 15px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .busan-map-header > div:last-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 5px;
    }
    
    .map-search-wrapper {
        flex: 1;
    }
    
    .map-search-wrapper input {
        width: 100% !important;
        font-size: 12px !important;
        padding: 4px 8px !important;
    }
    
    .busan-map-header .back-to-busan {
        white-space: nowrap; /* 1줄로 표시 */
        padding: 6px 10px;
        font-size: 11px;
        flex-shrink: 0;
    }
    
    .busan-map-header .close-map-btn {
        font-size: 20px;
        padding-left: 5px;
    }
}
