/* 房源地图样式 */

/* 地图容器 */
.properties-map-container {
    width: 100%;
    height: calc(100vh - 140px);
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: 0;
}

.properties-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
}

/* 确保地图内部元素不会产生滚动条 */
.properties-map-container * {
    box-sizing: border-box;
}

.properties-map-container .gm-style {
    overflow: hidden !important;
}

/* 地图加载状态 */
.map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #f8fafc;
    color: #64748b;
    font-size: 16px;
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: mapSpin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes mapSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 地图控制按钮 */
.map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    color: #64748b;
}

.map-control-btn:hover {
    background: #f1f5f9;
    color: #3b82f6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.map-control-btn svg {
    width: 20px;
    height: 20px;
}

/* 地图信息窗口样式增强 */
.gm-style .gm-style-iw-c {
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    max-width: 300px !important;
}

.gm-style .gm-style-iw-t::after {
    background: #ffffff !important;
    border-radius: 0 0 12px 12px !important;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
    border-radius: 12px !important;
}

/* 信息窗口内容样式 */
.map-info-window {
    font-family: 'Arial', sans-serif;
    line-height: 1.4;
}

.map-info-window .info-image img {
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.map-info-window .info-image img:hover {
    transform: scale(1.02);
}

.map-info-window .property-details {
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
    margin: 8px 0;
}

.map-info-window button {
    transition: all 0.2s ease;
    font-size: 14px;
}

.map-info-window button:hover {
    background: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* 视图切换按钮 */
.view-toggle-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    background: #f1f5f9;
    color: #3b82f6;
    border-color: #3b82f6;
}

.view-toggle-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* 地图视图时隐藏列表内容 */
.map-view-active .matched-properties-list {
    display: none !important;
}

.map-view-active .matched-properties-empty {
    display: none !important;
}

.map-view-active .matched-properties-loading {
    display: none !important;
}

/* 地图错误状态 */
.map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.map-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.map-error-message {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.map-error-subtitle {
    font-size: 14px;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .view-toggle-buttons {
        position: absolute;
        top: 12px;
        left: 12px;
        right: 12px;
        z-index: 10;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        padding: 8px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .view-toggle-btn {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 10px 8px;
    }
    
    .view-toggle-btn span {
        display: none;
    }
    
    .map-controls {
        top: 80px;
        right: 12px;
    }
    
    .properties-map {
        min-height: 300px;
    }
    
    .gm-style .gm-style-iw-c {
        max-width: 250px !important;
    }
    
    .map-info-window {
        font-size: 13px;
    }
    
    .map-info-window .info-image {
        margin-bottom: 8px;
    }
    
    .map-info-window .info-image img {
        height: 120px;
    }
}

/* 地图标记动画 */
@keyframes markerDrop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .map-control-btn {
        border-width: 0.5px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .properties-map-container {
        background: #1e293b;
    }
    
    .map-loading {
        background: #1e293b;
        color: #94a3b8;
    }
    
    .map-loading-spinner {
        border-color: #334155;
        border-top-color: #60a5fa;
    }
    
    .map-control-btn {
        background: #334155;
        border-color: #475569;
        color: #94a3b8;
    }
    
    .map-control-btn:hover {
        background: #475569;
        color: #60a5fa;
    }
    
    .view-toggle-btn {
        background: #334155;
        border-color: #475569;
        color: #94a3b8;
    }
    
    .view-toggle-btn:hover {
        background: #475569;
        color: #60a5fa;
        border-color: #60a5fa;
    }
    
    .view-toggle-btn.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }
} 