/* ============================================
   CELLMOM - システムマップ
   アースカラー × グラスモーフィズム
   ============================================ */

/* ---------- レイアウト ---------- */
#system-map {
    position: relative;
    overflow: hidden;
    height: calc(100vh - 64px);
    background: var(--color-background, #F5F1EB);
}

#system-map .smap-canvas-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#system-map canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#system-map canvas:active {
    cursor: grabbing;
}

/* ---------- ヘッダーツールバー ---------- */
.smap-toolbar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(212, 201, 184, 0.55);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.smap-toolbar h2 {
    margin: 0;
    font-size: 15px;
    color: var(--color-text, #3E3A35);
    white-space: nowrap;
    font-weight: 700;
}

.smap-search {
    flex: 0 1 280px;
    padding: 6px 12px;
    border: 1px solid var(--color-border, #D4C9B8);
    border-radius: 9px;
    background: rgba(255,255,255,.7);
    font-size: 13px;
    color: var(--color-text, #3E3A35);
    outline: none;
    transition: border-color .2s;
}
.smap-search:focus {
    border-color: var(--color-primary, #8B7355);
}
.smap-search::placeholder {
    color: var(--color-text-light, #6B6660);
}

/* ---------- フィルタボタン ---------- */
.smap-filters {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.smap-filter-btn {
    padding: 5px 12px;
    border: 1px solid var(--color-border, #D4C9B8);
    border-radius: 9px;
    background: rgba(255,255,255,.4);
    font-size: 12px;
    color: var(--color-text, #3E3A35);
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.smap-filter-btn:hover {
    background: rgba(255,255,255,.7);
}
.smap-filter-btn.active {
    background: var(--color-primary, #8B7355);
    color: #fff;
    border-color: var(--color-primary, #8B7355);
}

/* ---------- ズームコントロール ---------- */
.smap-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.smap-zoom-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(212, 201, 184, 0.55);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 18px;
    color: var(--color-text, #3E3A35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.smap-zoom-btn:hover {
    background: rgba(255,255,255,.8);
    border-color: var(--color-primary, #8B7355);
}

/* ---------- ミニマップ ---------- */
.smap-minimap {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    width: 180px;
    height: 120px;
    border: 1px solid rgba(212, 201, 184, 0.55);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
}
.smap-minimap canvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ---------- ノード詳細パネル ---------- */
.smap-detail-panel {
    position: absolute;
    top: 80px;
    right: 16px;
    z-index: 15;
    width: 320px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 16px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(212, 201, 184, 0.55);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(62, 58, 53, 0.12);
    transform: translateX(360px);
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.smap-detail-panel.open {
    transform: translateX(0);
    pointer-events: auto;
}

.smap-detail-panel .smap-detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--color-text-light, #6B6660);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.smap-detail-panel .smap-detail-close:hover {
    background: rgba(0,0,0,.06);
}

.smap-detail-panel h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--color-text, #3E3A35);
    padding-right: 32px;
}

.smap-detail-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
}

.smap-detail-section {
    margin-bottom: 12px;
}
.smap-detail-section h4 {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--color-text-light, #6B6660);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.smap-detail-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.smap-detail-section li {
    padding: 3px 0;
    font-size: 12px;
    color: var(--color-text, #3E3A35);
    cursor: pointer;
    border-radius: 4px;
    padding-left: 6px;
    transition: background .15s;
}
.smap-detail-section li:hover {
    background: rgba(139, 115, 85, .08);
}
.smap-detail-section li .smap-li-icon {
    margin-right: 4px;
}

/* ---------- 凡例 ---------- */
.smap-legend {
    position: absolute;
    bottom: 20px;
    left: 210px;
    z-index: 10;
    display: flex;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(212, 201, 184, 0.55);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 11px;
    color: var(--color-text, #3E3A35);
}
.smap-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.smap-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ---------- ステータスバー ---------- */
.smap-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(212, 201, 184, 0.4);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    font-size: 11px;
    color: var(--color-text-light, #6B6660);
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 768px) {
    .smap-toolbar {
        flex-wrap: wrap;
    }
    .smap-search {
        flex: 1 1 100%;
        order: 10;
    }
    .smap-legend {
        left: 16px;
        bottom: 70px;
        flex-wrap: wrap;
    }
    .smap-minimap {
        display: none;
    }
    .smap-detail-panel {
        width: calc(100% - 32px);
        right: 16px;
    }
}
