/* ================================================================
   課程地圖頁 — 地圖專屬樣式
   （側邊欄 / 卡片樣式由 _coursecss.css 負責）
   ================================================================ */

html {
    scroll-behavior: smooth;
}

/* ── 1. Hero Map Section ── */
.coursemap-hero {
    position: relative;
    background: #0f172a;
}

.coursemap-hero__inner {
    position: relative;
    width: 100%;
}

#googleMap {
    width: 100%;
    height: 520px;
    display: block;
}

/* ── 2. 懸浮統計面板（glassmorphism） ── */
.coursemap-hero__stats {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    padding: 8px;
    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
    white-space: nowrap;
    transition: .25s ease;
}

.stat-chip i {
    font-size: 15px;
    opacity: .7;
}

.stat-chip small {
    font-weight: 400;
    opacity: .7;
    margin-left: 2px;
}

.stat-chip.active {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 2px 12px rgba(99, 102, 241, .4);
}

.stat-chip.active i {
    opacity: 1;
}

/* ── 3. 地圖下方課程區域 ── */
.rbt-team-area.rbt-section-gap {
    padding-top: 30px;
}

/* ── 3.5 側邊欄 — 目前鄉鎮指示器 ── */
.current-town-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    color: #fff;
}

.current-town-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.current-town-info i {
    font-size: 16px;
    opacity: .85;
}

.current-town-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    cursor: pointer;
    transition: all .2s ease;
    font-size: 14px;
}

.current-town-reset:hover {
    background: rgba(255, 255, 255, .35);
    transform: scale(1.1);
}

/* ── 4. RWD ── */
@media (max-width: 767px) {
    #googleMap {
        height: 350px;
    }

    .coursemap-hero__stats {
        bottom: 12px;
        gap: 6px;
        padding: 6px;
        border-radius: 40px;
    }

    .stat-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .stat-chip small {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    #googleMap {
        height: 420px;
    }
}

/* ── 5. InfoWindow 彈框樣式（深色毛玻璃風格） ── */
.map-infowindow {
    min-width: 240px;
    max-width: 300px;
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    background: rgba(15, 23, 42, .92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    overflow: hidden;
    color: #fff;
}

.map-infowindow__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.map-infowindow__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.map-infowindow__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: .3px;
}

.map-infowindow__body {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-infowindow__stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.map-infowindow__stat+.map-infowindow__stat {
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding-top: 10px;
}

.map-infowindow__label {
    font-size: 13px;
    color: rgba(255, 255, 255, .55);
    font-weight: 500;
}

.map-infowindow__value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.map-infowindow__actions {
    display: flex;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.map-infowindow__btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    letter-spacing: .3px;
}

.map-infowindow__btn--close {
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .8);
    border: 1px solid rgba(255, 255, 255, .12);
}

.map-infowindow__btn--close:hover {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.map-infowindow__btn--go {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
}

.map-infowindow__btn--go:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .55);
    transform: translateY(-1px);
}

/* ── 6. 統計面板 — 可點擊互動 ── */
.stat-chip.clickable {
    cursor: pointer;
    user-select: none;
}

.stat-chip.clickable:hover {
    background: rgba(99, 102, 241, .25);
    transform: scale(1.04);
}

.stat-chip.active.clickable:hover {
    background: #4f46e5;
}

/* Google Maps InfoWindow — 隱藏預設白底及箭頭 */
.gm-style-iw-c {
    background: transparent !important;
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.gm-style-iw-d {
    overflow: visible !important;
    padding: 0 !important;
    background: transparent !important;
}

.gm-style-iw-tc {
    display: none !important;
}

/* 隱藏 Google Maps 預設 X 關閉按鈕（我們有自己的） */
.gm-style-iw-c button.gm-ui-hover-effect {
    display: none !important;
}