/* 全局变量 */
:root {
    --primary-color: #3498db;
    --helicopter-color: #e74c3c;
    --water-color: #2ecc71;
    --bg-light: rgba(255, 255, 255, 0.95);
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    --border-radius: 4px;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* 主容器布局 */
#app {
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* 地图容器 */
#map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
}

/* 搜索面板容器 */
.search-panel {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100%;
    max-width: 400px;
    padding: 0 15px;
}

.panel-content {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* 统计栏 */
.stats-row {
    display: flex;
    justify-content: space-around;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.stat-item:hover {
    background-color: rgba(236, 240, 241, 0.5);
}

.stat-item.active {
    background-color: rgba(236, 240, 241, 0.8);
    font-weight: bold;
}

.stat-item i {
    font-size: 18px;
}

.fa-globe {
    color: #333;
}

.fa-plane-departure {
    color: var(--primary-color);
}

.fa-helicopter {
    color: var(--helicopter-color);
}

.fa-water {
    color: var(--water-color);
}

.stat-count {
    font-size: 16px;
    font-weight: bold;
}

/* 搜索框 */
.search-row {
    display: flex;
    width: 100%;
}

.search-row input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
}

.search-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #2980b9;
}

/* 筛选控件 */
.filter-overlay {
    position: relative;
    width: 100%;
    z-index: 1000;
}

.filter-controls {
    display: flex;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px 8px 0 0;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    justify-content: space-around;
    width: 100%;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    text-align: center;
    flex-direction: column;
}

.filter-option.active {
    background-color: rgba(236, 240, 241, 0.8);
}

.filter-option i {
    font-size: 20px;
    margin-bottom: 5px;
}

.filter-count {
    font-size: 16px;
    font-weight: bold;
    background-color: transparent;
    padding: 2px 6px;
    min-width: 20px;
    text-align: center;
}

/* 机场标记样式 */
.airport-marker {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid white;
    z-index: 2;
    text-align: center;
    line-height: 30px;
}

.airport-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    z-index: 3;
}

.airport-marker.selected, 
.leaflet-marker-icon.selected {
    border-color: #ff6b6b !important;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.8);
    transform: scale(1.2);
    z-index: 999 !important;
}

.airport-marker i {
    font-size: 14px;
    color: #333;
    line-height: 30px;
}

/* 机场类型图标样式 */
.airport-marker.runway i,
.leaflet-marker-icon.runway i {
    color: var(--primary-color);
}

.airport-marker.helicopter i,
.leaflet-marker-icon.helicopter i {
    color: var(--helicopter-color);
}

.airport-marker.water i,
.leaflet-marker-icon.water i {
    color: var(--water-color);
}

/* 集群样式 */
.marker-cluster {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
    line-height: 40px !important;
    text-align: center !important;
}

.marker-cluster.runway {
    border: 3px solid var(--primary-color) !important;
}

.marker-cluster.helicopter {
    border: 3px solid var(--helicopter-color) !important;
}

.marker-cluster.water {
    border: 3px solid var(--water-color) !important;
}

.marker-cluster.small {
    font-size: 14px !important;
}

.marker-cluster.medium {
    font-size: 16px !important;
}

.marker-cluster.large {
    font-size: 18px !important;
}

/* 修复聚合点数字显示 */
.marker-cluster div {
    background-color: rgba(52, 152, 219, 0.7) !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 50% !important;
    width: 26px !important;
    height: 26px !important;
    line-height: 26px !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.marker-cluster-small, 
.marker-cluster-medium, 
.marker-cluster-large {
    background-color: transparent !important;
}

.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Leaflet标记样式 */
.leaflet-marker-icon {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* 弹出窗口样式 */
.leaflet-popup {
    max-width: 250px;
    z-index: 5;
}

.leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 10px;
}

.popup-content {
    text-align: center;
}

.popup-content h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #2c3e50;
}

.popup-content p {
    margin: 0;
    font-size: 14px;
    color: #7f8c8d;
}

/* 机场详情面板 */
.airport-panel {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 380px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1500;
    transition: opacity 0.5s;
    display: block;
    opacity: 1;
    visibility: visible;
    font-size: 12px;
}

.airport-panel.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* 根据机场类型设置面板标题栏颜色 */
.airport-panel .panel-header {
    background-color: #3498db; /* 默认蓝色，适用于跑道型机场 */
    color: white;
    padding: 6px 10px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 直升机场使用红色标题 */
.helicopter-airport .panel-header {
    background-color: #e74c3c;
}

/* 水上机场使用绿色标题 */
.water-airport .panel-header {
    background-color: #2ecc71;
}

/* 跑道型机场保持蓝色标题 */
.runway-airport .panel-header {
    background-color: #3498db;
}

.panel-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.2s;
}

.close-button:hover {
    color: #e74c3c;
}

/* 面板内容区域 */
.airport-panel .panel-content {
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

/* 机场信息表格 */
.airport-info-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.9);
}

.airport-info-table tr {
    border-bottom: 1px solid #eee;
}

.airport-info-table tr:last-child {
    border-bottom: none;
}

.airport-info-table td {
    padding: 5px 10px;
    line-height: 1.2;
}

.airport-info-table .label {
    width: 28%;
    font-weight: 500;
    color: #555;
    text-align: right;
    vertical-align: top;
}

.airport-info-table .value {
    width: 72%;
    color: #333;
}

.airport-info-table .coordinates-row {
    background-color: rgba(52, 152, 219, 0.1);
}

/* 坐标信息 */
.coordinates {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(0,0,0,0.1);
}

/* 加载指示器 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.spinner {
    font-size: 40px;
    color: #3498db;
    margin-bottom: 15px;
}

.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    z-index: 20;
    text-align: center;
}

.error-message button {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    padding: 5px 15px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* 头部信息 */
.header-info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 底部状态栏 */
.status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    display: none;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #7f8c8d;
    z-index: 10;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-item i {
    font-size: 14px;
    color: var(--primary-color);
}

/* MapLibre 控件自定义样式 */
.maplibregl-ctrl-group {
    border-radius: 4px;
    overflow: hidden;
}

.maplibregl-ctrl button {
    width: 30px;
    height: 30px;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .search-panel {
        padding: 0 10px;
        max-width: 90%;
    }
    
    .filter-overlay {
        right: 10px;
    }
    
    .filter-controls {
        padding: 5px 10px;
        gap: 10px;
    }
    
    .filter-option {
        padding: 3px 8px;
    }
    
    .airport-panel {
        width: calc(100% - 20px);
        max-width: 360px;
        left: 10px;
        right: 10px;
        bottom: 50px;
        margin: 0 auto;
    }
    
    .status-bar {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .stats-row {
        padding: 8px 5px;
    }
    
    .stat-item {
        padding: 3px;
        gap: 5px;
    }
    
    .stat-item i {
        font-size: 18px;
    }
    
    .stat-count {
        font-size: 16px;
    }
    
    .search-row input {
        padding: 10px;
    }
}

/* Leaflet 控件自定义样式 */
.leaflet-control-container .leaflet-control-zoom {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.leaflet-control-zoom a {
    background-color: var(--bg-light);
    color: #2c3e50;
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 16px;
}

.leaflet-control-zoom a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.7) !important;
    font-size: 10px !important;
    padding: 3px 8px !important;
}

/* 添加自定义标记样式 */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 2px solid white;
    text-align: center;
}

.marker-icon i {
    font-size: 14px;
}

.marker-icon.runway {
    border-color: #3498db;
}

.marker-icon.helicopter {
    border-color: #e74c3c;
}

.marker-icon.water {
    border-color: #2ecc71;
}

/* Leaflet弹窗样式 */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
    padding: 4px;
    text-align: center;
}

.leaflet-popup-content {
    margin: 8px;
    font-size: 14px;
}

/* Leaflet集群样式 */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(52, 152, 219, 0.7) !important;
    color: white !important;
    font-weight: bold !important;
    box-shadow: 0 0 0 2px white;
}

/* 隐藏底部控件 */
.leaflet-bottom {
    display: none !important;
}

/* 隐藏右下角控件 */
.leaflet-bottom.leaflet-right {
    display: none !important;
}

/* 隐藏所有底部状态栏 */
.status-bar, 
.leaflet-control-attribution,
[class^="leaflet-control-"],
[class*=" leaflet-control-"],
.leaflet-control-container .leaflet-bottom {
    display: none !important;
}

/* 经纬度点击复制样式 */
.copy-coords {
    cursor: pointer;
    position: relative;
    padding-right: 25px !important;
    transition: background-color 0.2s;
}

.copy-coords:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.copy-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 11px;
    opacity: 0.7;
}

.copy-coords:hover .copy-icon {
    color: #3498db;
    opacity: 1;
}

/* 复制成功动画 */
.copy-success {
    animation: fadeInOut 1.5s ease;
}

@keyframes fadeInOut {
    0% { background-color: rgba(46, 204, 113, 0.2); }
    50% { background-color: rgba(46, 204, 113, 0.4); }
    100% { background-color: rgba(52, 152, 219, 0.1); }
} 