/* 基本重置和全頁佈局 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* 地圖容器填滿螢幕 */
#map {
    width: 100%;
    height: 100%;
    background-color: #333; /* 深色背景，適合深色地圖主題 */
}

/* 控制面板樣式 */
#controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    z-index: 1000; /* 確保在最上層 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#controls h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* 圖例樣式 */
#legend {
    position: absolute;
    bottom: 30px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
#legend h4 {
    margin: 0 0 5px 0;
    text-align: center;
}
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}
.legend-item i {
    width: 18px;
    height: 18px;
    opacity: 0.8;
    margin-right: 8px;
    border: 1px solid #555;
}

/* 載入動畫遮罩 */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-size: 1.2em;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}