﻿/* =================================================
   MapEditor / MapViewer 공통 Core
   - MapEditor.razor의 1번째 <style>에서 공통만 추출
   ================================================= */

/* MapEditor Root */
.map-editor-root {
    width: 100%;
    max-width: none !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
/*.map-editor-toolbar {
    flex-shrink: 0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}*/

.map-editor-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--phoenix-border-color);
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
}

.map-editor-title {
    display: flex;
    align-items: center;
}

.map-editor-toolbar {
    flex-shrink: 0;
    border-radius: 0.5rem 0.5rem 0 0;
    margin-bottom: 0; /* 변경 */
    border: 1px solid var(--phoenix-border-color);
    border-bottom: none;
}
    .map-editor-toolbar .card-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
        .map-editor-toolbar .card-body.map-editor-toolbar-body {
            padding-left: 14px;
            padding-right: 16px;
        }

/* Body (Menu + Map) */
.map-editor-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    gap: 0.25rem;
}

/* Left : Map Menu */
.map-editor-menu {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f1f3f5;
    border-radius: 0.5rem;
    border: 1px solid var(--phoenix-border-color);
}

.map-editor-menu-header {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--phoenix-text-muted);
    border-bottom: 1px solid var(--phoenix-border-color);
}

.map-editor-menu-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8f9fa;
}

.map-editor-menu .nav {
    display: flex;
    flex-direction: column;
}

.map-editor-menu .nav-link,
.map-editor-menu .nav-link-text {
    color: #212529 !important;
}

    .map-editor-menu .nav-link:hover {
        background-color: #e9ecef;
        color: #000 !important;
    }

    .map-editor-menu .nav-link.active {
        background-color: #dee2e6;
        font-weight: 600;
        color: #000 !important;
    }

/* collapse 애니메이션 중 깜빡임 방지 */
.map-editor-menu .collapsing {
    display: block !important;
}

    .map-editor-menu .collapsing > .nav {
        display: flex !important;
        flex-direction: column !important;
    }

/* Right : Map Area */
/*.map-editor-map {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid var(--phoenix-border-color);
    overflow: hidden;
}*/

.map-editor-map {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--phoenix-border-color);
    border-top: none; /* 추가 */
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
}

.map-editor-map-header {
    flex-shrink: 0;
    padding: 0.35rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    background: #fff;
    border-bottom: 1px solid var(--phoenix-border-color);
}

/* 이동 대상 */
.map-stage {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}

    .map-stage > img {
        display: block;
        max-width: none;
        max-height: none;
        pointer-events: none;
        -webkit-user-drag: none;
    }

.map-editor-map-canvas {
    flex: 1;
    min-height: 0;
    margin: 0.25rem;
    position: relative;
    overflow: hidden;
    background: var(--phoenix-gray-200);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

    .map-editor-map-canvas::after {
        content: "";
        position: absolute;
        inset: 0;
        border: 1px solid var(--phoenix-border-color);
        pointer-events: none;
    }

    .map-editor-map-canvas.dragging {
        cursor: grabbing;
    }

    .map-editor-map-canvas.box-armed {
        cursor: url('/assets/img/eMap/cursor-cross.svg') 16 16, crosshair;
    }

    /* TO-BE [ADD] 혹시 선택 중 상태를 별도로 쓰고 싶으면 */
    .map-editor-map-canvas.box-selecting {
        cursor: crosshair;
    }

    .map-editor-map-canvas img {
        display: block;
        max-width: none;
        max-height: none;
        -webkit-user-drag: none;
        pointer-events: none;
    }

.map-zoom-toolbar button {
    width: 32px;
    height: 32px;
    padding: 0;
}


/* emap-nav 기본 레이아웃 */
.emap-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

    .emap-nav.collapse.show {
        display: flex;
    }

    /* 기본 메뉴 */
    .emap-nav .nav-link {
        padding: 0.375rem 0.5rem;
        color: #212529;
    }

    .emap-nav .emap-nav .nav-link {
        padding-left: 1.25rem;
    }

    .emap-nav .emap-nav .emap-nav .nav-link {
        padding-left: 2rem;
    }

    .emap-nav .nav-link:hover {
        background-color: #e9ecef;
    }

    .emap-nav .nav-link.active {
        background-color: #dee2e6;
        font-weight: 600;
    }

    .emap-nav .nav-link:hover .dropdown-indicator-icon {
        color: #000;
    }

    .emap-nav .nav-link.active .dropdown-indicator-icon {
        color: #0d6efd;
    }

/* EMapLayout root */
.emap-layout {
    width: 100%;
    height: 100%;
}

    /* 전체화면일 때 MapMenu 숨김 + Map 확장 */
    .emap-layout.emap-fullscreen .map-editor-menu {
        display: none !important;
    }

    .emap-layout.emap-fullscreen .map-editor-map {
        flex: 1 1 auto;
        width: 100%;
    }

.dropdown-indicator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    transition: transform 50ms linear;
    will-change: transform;
    transform: rotate(0deg);
}

    .dropdown-indicator-icon.expanded {
        transform: rotate(90deg);
    }

/* Fullscreen Exit Tag */
.map-exit-fullscreen-tag {
    position: fixed;
    left: -36px;
    bottom: 16px;
    z-index: 1200;
    width: 88px;
    height: 44px;
    border-radius: 0 999px 999px 0;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(11, 23, 39, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    cursor: pointer;
    animation: map-slide-in 0.25s ease-out forwards;
}

    .map-exit-fullscreen-tag:hover {
        background: rgba(11, 23, 39, 1);
    }

@keyframes map-slide-in {
    from {
        left: -36px;
        opacity: 0;
    }

    to {
        left: 8px;
        opacity: 1;
    }
}

.emap-door-tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 9999;
    pointer-events: none;
}
