/* GIS 지도 관리 시안 v3 - 세로 탭 바 + 슬라이드 콘텐츠 패널 */

.map4-container {
    background-color: #0f172a;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    color: rgb(226 232 240);
    min-height: 100vh;
    letter-spacing: -0.025em;
    overflow: hidden;
}

.map4-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.map4-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.map4-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    position: relative;
    overflow: hidden;
}

/* ══════════════════════════════════════
   세로 탭 바 (항상 보임, 좌측 44px)
   ══════════════════════════════════════ */
.map4-tab-bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: calc(100vh - 7rem);
    margin: 1rem 0 1rem 1rem;
    background: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    z-index: 42;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
    gap: 0;
    overflow: hidden;
}

.map4-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.75rem 0;
    cursor: pointer;
    transition: all 150ms;
    position: relative;
    border-left: 3px solid transparent;
}

.map4-tab-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.map4-tab-active {
    background: rgba(59, 130, 246, 0.12);
    border-left-color: #3b82f6;
}

.map4-tab-icon {
    font-size: 1.25rem;
    color: rgb(148 163 184);
    transition: color 150ms;
}

.map4-tab-active .map4-tab-icon {
    color: #60a5fa;
}

.map4-tab-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: rgb(148 163 184);
    line-height: 1;
    transition: color 150ms;
}

.map4-tab-active .map4-tab-text {
    color: #60a5fa;
}

/* ══════════════════════════════════════
   슬라이드 콘텐츠 패널 (탭 바 오른쪽)
   ══════════════════════════════════════ */
.map4-slide-panel {
    position: absolute;
    left: calc(44px + 1rem);
    top: 0;
    width: 280px;
    height: calc(100vh - 7rem);
    margin: 1rem 0;
    background: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    z-index: 41;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.map4-panel-hidden {
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
}

.map4-slide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.map4-slide-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.map4-slide-close {
    background: none;
    border: none;
    color: rgb(148 163 184);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map4-slide-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.map4-slide-close .material-symbols-outlined {
    font-size: 1.125rem;
}

.map4-slide-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
}

.map4-slide-body::-webkit-scrollbar {
    width: 4px;
}

.map4-slide-body::-webkit-scrollbar-track {
    background: transparent;
}

.map4-slide-body::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

/* ══════════════════════════════════════
   뷰 전환 토글 (드롭다운/트리)
   ══════════════════════════════════════ */
.map4-view-toggle {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    border: 1px solid rgb(51 65 85);
}

.map4-view-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: rgb(148 163 184);
    cursor: pointer;
    transition: all 150ms;
}

.map4-view-btn .material-symbols-outlined {
    font-size: 1.125rem;
}

.map4-view-btn:hover {
    color: rgb(226 232 240);
    background: rgba(51, 65, 85, 0.5);
}

.map4-view-btn-active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.map4-view-btn-active:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* ══════════════════════════════════════
   셀렉트 (드롭다운 모드)
   ══════════════════════════════════════ */
.map4-select-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map4-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: rgb(15 23 42);
    border: 1px solid rgb(51 65 85);
    border-radius: 0.5rem;
    color: rgb(226 232 240);
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
    transition: all 150ms;
    height: 36px;
}

.map4-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.map4-select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ══════════════════════════════════════
   트리 뷰
   ══════════════════════════════════════ */
.map4-tree {
    max-height: 100%;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.map4-tree::-webkit-scrollbar {
    width: 4px;
}

.map4-tree::-webkit-scrollbar-track {
    background: transparent;
}

.map4-tree::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

.map4-tree-node {
    display: flex;
    flex-direction: column;
}

.map4-tree-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 120ms;
    user-select: none;
}

.map4-tree-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.map4-tree-selected {
    background: rgba(59, 130, 246, 0.15) !important;
    outline: 1px solid rgba(59, 130, 246, 0.3);
}

.map4-tree-depth0 {
    padding-left: 0.25rem;
    font-weight: 600;
    font-size: 0.8125rem;
}

.map4-tree-depth1 {
    padding-left: 1.5rem;
    font-weight: 500;
    font-size: 0.775rem;
    color: rgb(203 213 225);
}

.map4-tree-depth2 {
    padding-left: 3rem;
    font-weight: 400;
    font-size: 0.75rem;
    color: rgb(148 163 184);
}

.map4-tree-toggle {
    font-size: 1.125rem;
    color: rgb(148 163 184);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 120ms;
}

.map4-tree-toggle:hover {
    color: #60a5fa;
}

.map4-tree-folder {
    font-size: 1rem;
    color: #f59e0b;
    flex-shrink: 0;
}

.map4-tree-leaf {
    font-size: 0.875rem;
    color: #60a5fa;
    flex-shrink: 0;
    margin-left: 0.125rem;
}

.map4-tree-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ══════════════════════════════════════
   레이어 그리드
   ══════════════════════════════════════ */
.map4-layer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.map4-layer-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: 64px;
    border-radius: 0.5rem;
    border: 1px solid rgb(51 65 85);
    background-color: rgba(30, 41, 59, 0.5);
    transition: all 150ms;
    cursor: pointer;
}

.map4-layer-chip:hover {
    border-color: #3b82f6;
}

.map4-layer-chip-active {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.map4-layer-checkbox {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.25rem;
    color: #3b82f6;
    cursor: pointer;
}

.map4-layer-checkbox:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

.map4-layer-icon {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.map4-layer-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.25;
}

/* ══════════════════════════════════════
   범례
   ══════════════════════════════════════ */
.map4-legend {
    background-color: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgb(30, 41, 59);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map4-legend-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map4-legend-category {
    font-size: 0.625rem;
    font-weight: 700;
    color: rgb(100 116 139);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgb(30, 41, 59);
    padding-bottom: 0.25rem;
}

.map4-legend-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.map4-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map4-legend-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
}

.map4-legend-text {
    font-size: 0.6875rem;
    color: rgb(148 163 184);
}

.map4-legend-pipes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map4-legend-pipe {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.map4-legend-line {
    width: 2rem;
    border-radius: 9999px;
}

.map4-legend-line-thick {
    height: 3px;
    background-color: #2563eb;
}

.map4-legend-line-dashed {
    height: 2px;
    background-color: #6366f1;
    border-bottom: 2px dashed rgba(99, 102, 241, 0.3);
}

.map4-legend-line-thin {
    height: 1.5px;
    background-color: #0891b2;
}

/* ══════════════════════════════════════
   지도 컨테이너
   ══════════════════════════════════════ */
.map4-map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: rgb(2, 6, 23);
}

.map4-status-filter {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.map4-status-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.7);
    background: rgba(51, 65, 85, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.map4-status-chip:hover {
    background: rgba(51, 65, 85, 0.5);
    color: rgba(226, 232, 240, 0.9);
}

.map4-status-chip-active {
    background: rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.25);
}

.map4-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.map4-map-background {
    width: 100%;
    height: 100%;
    background-image: url('../images/jin-an.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: contrast(1.1) brightness(0.6) saturate(0.8);
}

.map4-map-overlay {
    position: absolute;
    inset: 0;
}

/* ══════════════════════════════════════
   마커
   ══════════════════════════════════════ */
.map4-marker {
    position: absolute;
}

.map4-marker-pulse {
    position: absolute;
    inset: -0.75rem;
    background-color: rgba(59, 130, 246, 0.2);
    border-radius: 9999px;
    animation: map4-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes map4-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.map4-marker-pin {
    position: relative;
    cursor: pointer;
    background-color: #3b82f6;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    border: 2px solid white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.map4-marker-icon {
    font-size: 0.875rem;
    color: white;
}

.map4-marker-small {
    position: absolute;
}

.map4-marker-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    border: 2px solid white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 150ms;
}

.map4-marker-dot:hover {
    transform: scale(1.25);
}

/* ══════════════════════════════════════
   팝업
   ══════════════════════════════════════ */
.map4-popup {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    background-color: rgb(15, 23, 42);
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgb(51 65 85);
    overflow: hidden;
    z-index: 50;
}

.map4-popup-header {
    background-color: #3b82f6;
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.map4-popup-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.map4-popup-title .material-symbols-outlined {
    font-size: 1rem;
}

.map4-popup-close {
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 150ms;
}

.map4-popup-close:hover {
    color: white;
}

.map4-popup-close .material-symbols-outlined {
    font-size: 0.875rem;
}

.map4-popup-body {
    padding: 0;
}

.map4-popup-table {
    width: 100%;
    border-collapse: collapse;
}

.map4-popup-table tr {
    border-bottom: 1px solid rgb(51 65 85);
}

.map4-popup-table td:first-child {
    background-color: rgb(30, 41, 59);
    color: rgb(148, 163, 184);
    font-weight: 600;
    font-size: 0.6875rem;
    width: 90px;
    padding: 0.375rem 0.5rem;
}

.map4-popup-table td:last-child {
    background-color: rgb(15, 23, 42);
    color: rgb(241, 245, 249);
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
}

.map4-popup-highlight {
    font-weight: 700;
    color: #3b82f6 !important;
}

.map4-popup-footer {
    padding: 0.5rem;
    background-color: rgba(30, 41, 59, 0.5);
    border-top: 1px solid rgb(51 65 85);
}

.map4-popup-button {
    width: 100%;
    padding: 0.5rem 0;
    background-color: rgb(30, 41, 59);
    border: 1px solid rgb(51 65 85);
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: rgb(203, 213, 225);
    cursor: pointer;
    transition: background-color 150ms;
}

.map4-popup-button:hover {
    background-color: rgb(51, 65, 85);
}

.map4-popup-arrow {
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 1rem;
    height: 1rem;
    background-color: rgba(30, 41, 59, 0.5);
    border-right: 1px solid rgb(51 65 85);
    border-bottom: 1px solid rgb(51 65 85);
}

.map4-pipe-svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* ══════════════════════════════════════
   컨트롤 버튼
   ══════════════════════════════════════ */
.map4-controls {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 40;
}

.map4-zoom-controls {
    display: flex;
    flex-direction: column;
    background-color: rgb(15, 23, 42);
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgb(51 65 85);
    overflow: hidden;
}

.map4-zoom-button {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(203, 213, 225);
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 150ms;
}

.map4-zoom-button:hover {
    background-color: rgb(30, 41, 59);
}

.map4-zoom-button:first-child {
    border-bottom: 1px solid rgb(30, 41, 59);
}

.map4-control-button {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(15, 23, 42);
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgb(51 65 85);
    color: rgb(203, 213, 225);
    cursor: pointer;
    transition: background-color 150ms;
}

.map4-control-button:hover {
    background-color: rgb(30, 41, 59);
}

.map4-control-button-active {
    color: #3b82f6;
}

/* ══════════════════════════════════════
   정보 바
   ══════════════════════════════════════ */
.map4-info-bar {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(51 65 85);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.map4-info-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgb(226, 232, 240);
}

.map4-info-icon {
    font-size: 0.875rem;
}

.map4-info-divider {
    height: 0.75rem;
    width: 1px;
    background-color: rgb(51, 65, 85);
}
