/* wwwroot/styles.css */

/* 1. 基礎設定 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: "Microsoft JhengHei", sans-serif;
}

/* 2. 地圖層 */
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: grab;
}

    #map.mode-add-point {
        cursor: crosshair;
    }

/* 3. 浮動面板通用 */
.floating-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 4. 左上角面板 */
.top-left-role {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2000 !important;
    min-width: 200px;
}

/* 5. 右上角面板 */
.top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 340px;
    z-index: 2000 !important;
    /* [關鍵修改] 
       原本是 85vh (佔螢幕 85%)，容易蓋到下面。
       改為：螢幕總高 (100vh) - 下方列表高 (160px) - 下方間距 (20px) - 上方間距 (20px) - 緩衝區 (20px)
       總共約扣除 220px ~ 240px
    */
    max-height: calc(100vh - 240px);
    overflow-y: auto; /* 超出高度時出現捲軸 */
    /* [新增] 讓捲動更平滑，且隱藏捲軸以保持美觀 (選用) */
    scrollbar-width: thin; /* Firefox */
}

/* 6. 下方團隊列表 (這裡最關鍵！) */
.bottom-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 2000 !important; /* 確保蓋在地圖上面 */
    height: 160px; /* 確保有高度 */
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px;
    pointer-events: auto;
    background: transparent; /* 容器透明，卡片白色 */
    /* 滑動設定 */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
}

    /* 拖曳時的樣式 */
    .bottom-panel.active {
        cursor: grabbing !important;
        scroll-snap-type: none !important;
        scroll-behavior: auto !important;
    }

/* 7. 捲軸樣式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* 8. 團隊卡片 */
.team-card {
    min-width: 240px;
    height: 100%;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: white; /* 卡片必須是白色 */
    border-radius: 12px;
    position: relative;
    scroll-snap-align: start;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

    .team-card:hover {
        transform: translateY(-2px);
    }

    .team-card.active {
        border-color: #3b82f6;
        border-width: 2px;
        background-color: #eff6ff;
    }

/* 9. 地圖標記 */
.marker-pin {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.marker-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    background-color: white;
    transition: transform 0.2s;
}

/* 10. 摺疊 */
details > summary {
    list-style: none;
    cursor: pointer;
    transition: background 0.2s;
}

    details > summary::-webkit-details-marker {
        display: none;
    }
