/**
 * goflymap.com - 样式表
 * 地图网站专用样式
 */

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* ==================== 主容器 ==================== */
.main-container {
    display: flex;
    height: 100vh;
    padding-top: 56px; /* 导航栏高度 */
}

/* ==================== 左侧面板 ==================== */
.sidebar-panel {
    width: 380px;
    min-width: 380px;
    height: calc(100vh - 56px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-header h5 {
    color: white;
}

.sidebar-body {
    padding: 1.5rem;
}

/* 移动端侧边栏隐藏 */
@media (max-width: 768px) {
    .sidebar-panel {
        position: fixed;
        left: 0;
        top: 56px;
        transform: translateX(-100%);
        width: 100%;
        max-width: 380px;
    }
    
    .sidebar-panel.open {
        transform: translateX(0);
    }
}

/* ==================== 地图容器 ==================== */
.map-container {
    flex: 1;
    position: relative;
    height: calc(100vh - 56px);
}

#map {
    width: 100%;
    height: 100%;
}

/* ==================== 地图类型切换 ==================== */
.map-type-switcher {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
}

.map-type-switcher .btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-type-switcher .btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.map-type-switcher .btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ==================== 定位按钮 ==================== */
.locate-button {
    position: absolute;
    bottom: 30px;
    right: 15px;
    z-index: 1000;
}

.locate-button .btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==================== 地图标记样式 ==================== */

/* 用户位置标记 - 脉冲效果 */
.user-location-marker {
    background: transparent !important;
    border: none !important;
}

.pulse-dot {
    width: 20px;
    height: 20px;
    background: #4285F4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(66, 133, 244, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
    }
}

/* 目的地标记 */
.dest-marker {
    background: transparent !important;
    border: none !important;
}

.dest-marker-inner {
    background: #FF5252;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(255, 82, 82, 0.4);
}

.dest-marker-inner i {
    transform: rotate(45deg);
    font-size: 1.2rem;
}

.marker-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ==================== 弹出窗口样式 ==================== */
.popup-content h6 {
    color: #1a1a1a;
    margin-bottom: 4px;
}

.popup-content p {
    font-size: 0.85rem;
}

/* Leaflet 弹出窗口自定义 */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    font-family: inherit !important;
}

/* ==================== 表单样式 ==================== */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 输入组样式 */
.input-group-text {
    background: #f8f9fa;
}

/* ==================== 卡片样式 ==================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ==================== 按钮样式 ==================== */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    border: none;
}

.btn-warning {
    background: #f59e0b;
    border: none;
    color: white;
}

/* ==================== 加载遮罩 ==================== */
.loading-overlay {
    position: fixed;
    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: 9999;
}

/* ==================== 导航选择弹窗 ==================== */
.navigation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.navigation-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    min-width: 300px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.navigation-modal-content h6 {
    color: #1a1a1a;
}

/* ==================== 滚动条美化 ==================== */
.sidebar-panel::-webkit-scrollbar {
    width: 6px;
}

.sidebar-panel::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-panel::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.sidebar-panel::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .sidebar-panel {
        padding-top: 0;
    }
    
    .sidebar-body {
        padding: 1rem;
    }
    
    .map-type-switcher {
        top: 10px;
        right: 10px;
    }
    
    .locate-button {
        bottom: 20px;
        right: 10px;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#searchResult,
#routeInfo {
    animation: fadeIn 0.3s ease;
}

/* ==================== 警告提示 ==================== */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

/* ==================== PIN 弹窗样式 ==================== */
.pin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.pin-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.pin-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 90%;
    animation: fadeIn 0.3s ease;
}

.pin-modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 16px 16px 0 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.pin-modal-body {
    padding: 1.5rem;
}

.pin-modal-body p {
    font-size: 0.9rem;
}

.pin-input {
    width: 100%;
    padding: 12px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.pin-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25);
}

.pin-actions {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}

.pin-actions .btn {
    flex: 1;
}
