/* Map page styles */

.map-search {
    position: relative;
    width: min(360px, 72vw);
}

.map-search-suggest {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 320px;
    overflow: auto;
}

.map-search-suggest button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1d1d1f;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.map-search-suggest button.is-active,
.map-search-suggest button:hover {
    background: #f3f3f8;
}

.map-search-suggest .map-search-name {
    display: block;
    font-weight: 600;
    word-break: break-word;
}

.map-search-suggest .map-search-meta {
    display: block;
    margin-top: 2px;
    color: #6e6e73;
    font-size: 0.75rem;
}

#provider-map {
    background-color: #f8f9fa;
}

/* Google Maps InfoWindow styling override */
.gm-style-iw-d {
    overflow: hidden !important;
}

.gm-style-iw {
    padding: 12px !important;
}

/* AMap InfoWindow styling */
.amap-info-content {
    padding: 0;
}

/* Custom info window */
.map-info-window {
    padding: 8px;
    font-family: inherit;
}

.map-info-window h6 {
    font-size: 0.95rem;
    line-height: 1.3;
}

.map-info-window .info-name-tc {
    font-size: 0.85rem;
}

/* Cluster styling - 聚合標記樣式 */
.marker-cluster {
    background-color: rgba(105, 108, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.marker-cluster:hover {
    transform: scale(1.1);
}

.marker-cluster-small {
    width: 40px;
    height: 40px;
    font-size: 12px;
    background-color: rgba(105, 108, 255, 0.85);
}

.marker-cluster-medium {
    width: 50px;
    height: 50px;
    font-size: 14px;
    background-color: rgba(255, 159, 67, 0.9);
}

.marker-cluster-large {
    width: 60px;
    height: 60px;
    font-size: 16px;
    background-color: rgba(234, 84, 85, 0.9);
}

.marker-cluster-xlarge {
    width: 70px;
    height: 70px;
    font-size: 18px;
    background-color: rgba(168, 85, 247, 0.95);
}

/* Google Maps 聚合標記文字樣式覆蓋 */
.gm-style div[style*="cursor: pointer"] {
    transition: transform 0.2s ease;
}

.gm-style div[style*="cursor: pointer"]:hover {
    transform: scale(1.05);
}

/* 高德地圖聚合標記動畫 */
.amap-cluster {
    animation: clusterPulse 2s infinite;
}

@keyframes clusterPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 16px rgba(105, 108, 255, 0.5);
    }
}

/* Loading overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.map-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #provider-map {
        height: 450px !important;
    }
    
    .map-info-window {
        min-width: 200px;
        max-width: 260px;
    }
}

@media (max-width: 576px) {
    #provider-map {
        height: 350px !important;
    }
}
