:root {
    --primary: #2C3E50;
    --secondary: #34495E;
    --accent: #E74C3C;
    --light-bg: #F4F6F7;
    --border: #BDC3C7;
    --text: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.map-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--light-bg);
}

.map-header {
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.stats {
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    z-index: 500;
}

.filters {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background-color: #FAFAFA;
}

.filter-group {
    margin-top: 1rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.property-list-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.property-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.property-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
}

.property-card:hover, .property-card.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #eee;
}

.card-content {
    padding: 1rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.3;
}

.card-price {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.card-details {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.card-address {
    font-size: 0.8rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    width: 250px !important;
}

.popup-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.popup-info {
    padding: 1rem;
}

.popup-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.popup-price {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.popup-details {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.8rem;
}

.popup-link {
    display: inline-block;
    background-color: var(--primary);
    color: white !important;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
    transition: background 0.2s;
}

.popup-link:hover {
    background-color: var(--secondary);
}

.marker-legend {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
