/**
 * 中国天气预报系统 - 地图页样式
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* 全屏地图容器 */
#mapContainer {
    width: 100%;
    height: 100%;
}

/* 浮动工具栏 */
.floating-toolbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toolbar-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #555;
    background: #f5f5f5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.toolbar-btn:hover {
    background: #e0e0e0;
}

.toolbar-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toolbar-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 浮动图例 */
.floating-legend {
    position: fixed;
    left: 20px;
    bottom: 80px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #555;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend-marker.normal {
    background-color: #81c784;
}

.legend-marker.warning {
    background-color: #ffb74d;
}

.legend-marker.danger {
    background-color: #e57373;
}

/* 浮动时间戳 */
.floating-timestamp {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 0.85rem;
    color: #555;
}

/* 详情面板 */
.detail-panel {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 320px;
    max-height: calc(100vh - 160px);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow: hidden;
    transition: all 0.3s ease;
}

.detail-panel.hidden {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.panel-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.panel-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 240px);
}

/* 面板内容样式 */
.panel-temperature {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
}

.panel-temperature::after {
    content: '°C';
    font-size: 1.5rem;
    font-weight: normal;
}

.panel-weather {
    text-align: center;
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.panel-details {
    display: grid;
    gap: 12px;
}

.panel-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.panel-detail-label {
    color: #888;
    font-size: 0.9rem;
}

.panel-detail-value {
    font-weight: 600;
    color: #333;
}

.panel-severity {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: white;
}

.panel-severity.normal {
    background-color: #81c784;
}

.panel-severity.warning {
    background-color: #ffb74d;
}

.panel-severity.danger {
    background-color: #e57373;
}

/* 高德地图信息窗口样式覆盖 */
.amap-info-content {
    padding: 0 !important;
}

.marker-popup {
    padding: 12px 15px;
    min-width: 180px;
}

.popup-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #333;
}

.popup-temp {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.popup-weather {
    color: #555;
    margin-bottom: 8px;
}

.popup-details {
    font-size: 0.85rem;
    color: #777;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .floating-toolbar {
        top: 10px;
        padding: 8px 12px;
    }
    
    .toolbar-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .floating-legend {
        left: 10px;
        bottom: 70px;
        padding: 10px;
    }
    
    .floating-timestamp {
        right: 10px;
        bottom: 10px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .detail-panel {
        right: 10px;
        left: 10px;
        width: auto;
        top: 60px;
    }
}
