/* Interactive Map Guide Public Stylesheet */

.interactive-map-guide-container {
    width: 100%;
    max-width: 1100px;
    margin: 75px auto 30px auto !important;
    padding-top: 15px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
    position: relative;
    overflow: visible !important;
}

.img-map-notice {
    padding: 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* 1. 맵 뷰포트 레이어 */
.img-map-viewport {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: visible !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12);
    background: #ffffff;
}

.img-map-base-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    user-select: none;
    -webkit-user-drag: none;
}

.img-map-pins-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 2. 맵 숫자 핀 스타일 */
.img-map-pin {
    position: absolute;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.img-map-pin-badge {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

/* 호버 및 액티브 애니메이션 */
.img-map-pin:hover,
.img-map-pin.active {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 50;
}

.img-map-pin:hover .img-map-pin-badge,
.img-map-pin.active .img-map-pin-badge {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    box-shadow: 0 0 0 6px rgba(13, 148, 136, 0.25), 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 3. 스마트 마우스 오버 툴팁 (스마트 위치 정렬) */
.img-map-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    min-width: 110px;
    text-align: center;
}

/* 툴팁 화살표 기본 */
.img-map-tooltip::after {
    content: '';
    position: absolute;
    border-width: 6px;
    border-style: solid;
}

/* A. 핀 상단 툴팁 (기본형: pos-top) */
.img-map-pin.pos-top .img-map-tooltip {
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
}

.img-map-pin.pos-top .img-map-tooltip::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.img-map-pin.pos-top:hover .img-map-tooltip,
.img-map-pin.pos-top.active .img-map-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* B. 핀 하단 툴팁 (상단 경계선 핀: pos-bottom) */
.img-map-pin.pos-bottom .img-map-tooltip {
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
}

.img-map-pin.pos-bottom .img-map-tooltip::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: transparent transparent rgba(15, 23, 42, 0.95) transparent;
}

.img-map-pin.pos-bottom:hover .img-map-tooltip,
.img-map-pin.pos-bottom.active .img-map-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* C. 좌측 벽 정렬 (align-left) */
.img-map-pin.align-left .img-map-tooltip {
    left: 0 !important;
    transform: translateX(0) !important;
}

.img-map-pin.align-left .img-map-tooltip::after {
    left: 17px !important;
    transform: none !important;
}

/* D. 우측 벽 정렬 (align-right) */
.img-map-pin.align-right .img-map-tooltip {
    left: auto !important;
    right: 0 !important;
    transform: translateX(0) !important;
}

.img-map-pin.align-right .img-map-tooltip::after {
    left: auto !important;
    right: 17px !important;
    transform: none !important;
}

.img-map-tooltip-title {
    font-weight: 700;
    font-size: 14px;
    color: #38bdf8;
    margin-bottom: 3px;
}

.img-map-tooltip-desc {
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.4;
    white-space: normal;
    max-width: 220px;
}

/* 4. 하단 항시 노출 목록 (Legend Grid) */
.img-map-legend-wrap {
    margin-top: 35px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.img-map-legend-heading {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.img-map-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.img-map-legend-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.img-map-legend-card:hover,
.img-map-legend-card.active {
    background: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.15);
    transform: translateY(-2px);
}

.img-map-legend-num {
    width: 30px;
    height: 30px;
    background: #0284c7;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.img-map-legend-card:hover .img-map-legend-num,
.img-map-legend-card.active .img-map-legend-num {
    background: #0d9488;
}

.img-map-legend-title {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    line-height: 1.3;
}

.img-map-legend-subtext {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

/* 반응형 모바일 모드 */
@media (max-width: 640px) {
    .img-map-pin {
        width: 26px;
        height: 26px;
    }
    .img-map-pin-badge {
        font-size: 11px;
    }
    .img-map-legend-grid {
        grid-template-columns: 1fr;
    }
}
