/* 匹配房源面板样式 */
.matched-properties-panel {
    position: fixed;
    top: 0;
    left: -50%; /* 改为50%宽度 */
    width: 50%; /* 面板宽度改为屏幕的一半 */
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1); /* 改为右侧阴影 */
    z-index: 1000;
    transition: left 0.3s ease; /* 改为left过渡 */
    overflow: hidden;
    border-right: 1px solid #e1e5e9; /* 改为右侧边框 */
}

.matched-properties-panel.open {
    left: 0; /* 改为left: 0 */
}

/* 当面板打开时，主体内容右移 */
body.matched-properties-open .chat-container {
    margin-left: 50%; /* 聊天内容左移50%给面板让位 */
    transition: margin-left 0.3s ease; /* 改为margin-left */
    width: 50%;
}

body.matched-properties-open .input-area {
    margin-left: 25% !important; /* 输入区域左移50% */
    max-width: 45% !important; /* 输入区域最大宽度50% */
    transition: margin-left 0s ease; /* 改为margin-left */
}

body.matched-properties-open .quick-buttons {
    margin-left: 32% !important; /* 快捷按钮左移50% */
    transition: margin-left 0s ease; /* 改为margin-left */
}

body.matched-properties-open .footer-disclaimer {
    margin-left: 25% !important; /* 页脚声明左移50% */
    transition: margin-left 0s ease; /* 改为margin-left */
}

body.matched-properties-open .favorites-panel {
    right: 0px; /* 保持favorites面板在右侧 */
    transition: right 0s ease;
}

/* 当匹配房源面板打开时，调整主页眉 */
body.matched-properties-open .header {
    transform: translateX(16%); /* 页眉右移50% */
    transition: transform 0s ease;
}

body.matched-properties-open .logo-container {
    display: none;
    transform: translateX(140%); /* Logo容器右移50% */
    transition: transform 0s ease;
}

.matched-properties-header {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    background: #ffffff;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

/* 标签页导航 */
.panel-nav-tabs {
    display: flex;
    gap: 0;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    position: relative;
}

.nav-tab.active {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-tab:hover:not(.active) {
    color: #475569;
    background: rgba(255, 255, 255, 0.5);
}

.tab-count {
    background: #64748b;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.nav-tab.active .tab-count {
    background: #3b82f6;
}

.matched-properties-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.close-matched-properties {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-matched-properties:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.matched-properties-content {
    padding: 12px 20px 20px 20px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

/* 地图视图时禁用父容器滚动 */
.matched-properties-content.map-view-active {
    overflow: hidden;
    padding: 0;
}

/* 加载状态 */
.matched-properties-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #718096;
}

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

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

/* 空状态 */
.matched-properties-empty {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

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

.matched-empty-subtitle {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.8;
}

/* 房源列表 */
.matched-properties-list {
    display: grid !important; /* 改为grid布局 */
    grid-template-columns: 1fr 1fr !important; /* 每行显示两个房源卡片 */
    gap: 16px !important; /* 房源卡片之间的间距 */
    padding: 8px;
    padding-bottom: 100px; /* 底部留出空间 */
    width: 100%;
}

/* 强制确保房源卡片在grid中正确显示 */
.matched-properties-panel .matched-properties-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
}

/* 房源卡片设计 */
.matched-property-card {
    border: 3px solid #cbd5e0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    margin: 0; /* 移除margin，使用grid gap控制间距 */
    display: block;
    user-select: none;
}

.matched-property-card:hover {
    border-color: #4299e1;
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.2);
    transform: translateY(-3px);
}

/* 房源图片区域 */
.property-image-container {
    position: relative;
    width: 100%;
    height: 150px; /* 减小高度以适应两列布局 */
    background: #f7fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-image-container img {
    transition: transform 0.3s ease;
}

/* floorplan图片：保持原有contain样式 */
.property-image-floorplan {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 实景图片：占满整个容器 */
.property-image-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-image-container:hover .property-image-floorplan,
.property-image-container:hover .property-image-photo {
    transform: scale(1.05);
}

.property-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    color: #a0aec0;
    font-size: 14px;
    flex-direction: column;
    gap: 8px;
}

.property-no-image::before {
    content: "🏠";
    font-size: 32px;
    opacity: 0.6;
}

/* 入住时间标签 */
.property-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: white;
    color: #0076FF;
    border: 2px solid #0076FF;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* 匹配度标签 */
.property-match-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #0076FF 0%, #00C6FF 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 118, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    text-align: center;
}

.match-percentage-value {
    font-size: 18px;
    font-weight: 700;
}

.match-percentage-text {
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
}

/* 房源信息区域 */
.property-info {
    padding: 16px;
}

/* 房源标题行 - 房源名称+价格 */
.property-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.property-name {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin: 0;
    min-width: 0;
}

.property-price {
    font-size: 18px;
    font-weight: 700;
    color: #215389;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
}

/* 位置和设施标签行 */
.property-location-amenities-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.property-location {
    font-size: 14px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.property-amenities-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 2.2em;
    overflow: hidden;
    flex-shrink: 0;
    justify-content: flex-end;
}

/* 匹配房源切换按钮 */
.matched-properties-toggle {
    position: fixed;
    top: 20px; /* 改为顶部 */
    left: 20px; /* 保持左侧 */
    transform: none; /* 移除垂直居中变换 */
    width: 28px;
    height: 28px;
    background: linear-gradient(90deg, #44d1f4 0%, #333fe3 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(68, 209, 244, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.matched-properties-toggle:hover {
    background: linear-gradient(90deg, #21c3ec 0%, #0f1de0 100%);
    transform: scale(1.05); /* 只保留缩放效果 */
    box-shadow: 0 6px 16px rgba(68, 209, 244, 0.4);
}

.matched-properties-toggle svg {
    width: 20px;
    height: 20px;
}

/* 当面板打开时，按钮位置调整 */
body.matched-properties-open .matched-properties-toggle {
    display: none;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .matched-properties-panel {
        width: 100vw;
        left: -100vw; /* 改为左侧隐藏 */
    }
    
    .matched-properties-panel.open {
        left: 0; /* 改为left: 0 */
    }
    
    body.matched-properties-open .chat-container {
        margin-left: 0; /* 移动端保持原样 */
        display: none;
    }
    
    body.matched-properties-open .favorites-panel {
        right: 0;
    }
    
    body.matched-properties-open .matched-properties-toggle {
        left: 20px; /* 改为左侧 */
    }
    
    /* 移动端房源列表改为单列显示 */
    .matched-properties-list {
        grid-template-columns: 1fr !important; /* 移动端每行显示一个房源卡片 */
        gap: 16px !important;
        padding: 0 !important; /* 移除列表的padding */
    }
    
    /* 强制确保房源卡片在移动端grid中单列显示 */
    .matched-properties-panel .matched-properties-list {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 0 !important;
    }
    
    /* 移动端房源卡片调整 */
    .matched-property-card {
        margin: 0 !important;
        width: 100% !important;
    }
    
    /* 移动端图片容器高度调整 */
    .property-image-container {
        height: 180px !important; /* 单列时可以稍微增加高度 */
    }
    
    /* 移动端地图切换按钮简化 - 只显示图标，提高优先级 */
    .matched-properties-panel .view-toggle-buttons {
        position: static !important; /* 覆盖properties-map.css的position: absolute */
        background: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
    }
    
    .matched-properties-panel .view-toggle-btn {
        padding: 6px !important; /* 更小的padding */
        min-width: 32px !important;
        width: 32px !important;
        height: 32px !important;
        flex: none !important; /* 覆盖flex: 1 */
        font-size: 12px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 4px !important;
    }
    
    .matched-properties-panel .view-toggle-btn span {
        display: none !important; /* 隐藏文字，只保留图标 */
    }
    
    .matched-properties-panel .view-toggle-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* 滚动条样式 */
.matched-properties-content::-webkit-scrollbar {
    width: 6px;
}

.matched-properties-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.matched-properties-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.matched-properties-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.amenity-tag {
    display: inline-block;
    background: #e6fffa;
    color: #065f46;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
    border: 1px solid #a7f3d0;
    font-weight: 500;
}

/* 收藏房源卡片样式 - 继承匹配房源基础样式，hover效果保持一致 */
.favorite-property-card:hover {
    border-color: #4299e1 !important;
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.2) !important;
    transform: translateY(-3px);
}

/* 心形按钮容器 - 保持在右上角 */
.property-favorite-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    pointer-events: auto; /* 确保可以点击 */
}

.favorite-heart-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: auto; /* 确保可以点击 */
}

.favorite-heart-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.favorite-heart-btn svg {
    transition: all 0.2s ease;
}

.favorite-heart-btn:hover svg {
    transform: scale(1.1);
}

/* 用户偏好展示样式 */
.user-preference-section {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.user-preference-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.preference-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.preference-expanded {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.preference-item {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.preference-item:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.preference-toggle-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.preference-toggle-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.preference-more {
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
    align-self: center;
} 