/* ================================================
   Interactive Image Map - Frontend Styles
   ================================================ */

/* ---- Container ---- */
.iim-map-container {
    position: relative;
    max-width: 100%;
    font-size: 0;
    line-height: 0;
    background: #2c3e50;
}

.iim-map-image-wrap {
    position: relative;
    display: block;
    line-height: 0;
}

.iim-map-container img.iim-image {
    display: block;
    width: 100%;
    height: auto;
}

/* ---- SVG Overlay ---- */
.iim-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

.iim-hotspot {
    cursor: pointer;
    pointer-events: all;
    transition: fill-opacity 0.3s ease, stroke-opacity 0.3s ease;
}

.iim-hotspot:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ---- Map Labels (appear on hover) ---- */
.iim-map-label {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 50;
    animation: iim-label-pop 0.25s ease;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}

.iim-map-label-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.iim-map-label-text {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.5);
}

@keyframes iim-label-pop {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ---- Bottom Navigation Bar ---- */
.iim-bottom-bar {
    background: rgba(55, 71, 79, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 14px;
    line-height: 1.3;
    -webkit-overflow-scrolling: touch;
}

.iim-bottom-bar::-webkit-scrollbar {
    height: 3px;
}

.iim-bottom-bar::-webkit-scrollbar-track {
    background: transparent;
}

.iim-bottom-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.iim-bottom-bar-inner {
    display: flex;
    min-width: max-content;
}

.iim-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    min-width: 80px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.iim-bar-item:hover,
.iim-bar-item.active {
    background: #c0392b;
}

.iim-bar-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    transition: background 0.25s ease;
}

.iim-bar-item:hover .iim-bar-num,
.iim-bar-item.active .iim-bar-num {
    background: rgba(255, 255, 255, 0.3);
}

.iim-bar-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.25s ease;
}

.iim-bar-item:hover .iim-bar-title,
.iim-bar-item.active .iim-bar-title {
    color: #fff;
}

/* ---- Detail Panel (Full Overlay) ---- */
.iim-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100000;
    display: flex;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 16px;
    line-height: 1.6;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.iim-detail-overlay.iim-detail-visible {
    opacity: 1;
}

.iim-detail-panel {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---- Detail Sidebar ---- */
.iim-detail-sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(44, 62, 80, 0.98);
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.iim-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.iim-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.iim-sidebar-item.active {
    background: #c0392b;
    color: #fff;
}

.iim-sidebar-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.iim-sidebar-item.active .iim-sidebar-num {
    background: rgba(255, 255, 255, 0.3);
}

.iim-sidebar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Detail Content ---- */
.iim-detail-content {
    flex: 1;
    background: #fff;
    overflow-y: auto;
    position: relative;
    padding: 40px 50px;
}

.iim-detail-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.iim-detail-close:hover {
    color: #333;
    background: #f0f0f0;
}

.iim-detail-body {
    transition: opacity 0.15s ease;
}

.iim-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.iim-detail-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 4px;
}

.iim-detail-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.3;
}

.iim-detail-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

.iim-detail-desc h2,
.iim-detail-desc h3,
.iim-detail-desc h4 {
    color: #1d2327;
    margin-top: 24px;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.iim-detail-desc h2 {
    font-size: 18px;
}

.iim-detail-desc h3 {
    font-size: 16px;
}

.iim-detail-desc p {
    margin-bottom: 14px;
}

.iim-detail-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ---- Loading ---- */
.iim-map-container.iim-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: iim-spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes iim-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .iim-bar-item {
        padding: 10px 12px;
        min-width: 60px;
    }

    .iim-bar-title {
        font-size: 9px;
        max-width: 70px;
    }

    .iim-detail-panel {
        flex-direction: column;
    }

    .iim-detail-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 35vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .iim-detail-content {
        padding: 24px 20px;
    }

    .iim-detail-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .iim-bar-item {
        padding: 8px 10px;
        min-width: 55px;
    }

    .iim-bar-title {
        font-size: 8px;
        max-width: 55px;
    }

    .iim-detail-content {
        padding: 20px 16px;
    }

    .iim-detail-title {
        font-size: 20px;
    }
}

/* ---- Print ---- */
@media print {

    .iim-svg-overlay,
    .iim-bottom-bar,
    .iim-map-label,
    .iim-detail-overlay {
        display: none !important;
    }
}