/* Map tab: search results on a San Francisco map (static/js/results_map.js) */

.map-view {
    width: 100%;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
}

.map-view[hidden] {
    display: none;
}

.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.map-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    min-height: 1.75rem;
}

.map-count b {
    font-weight: 700;
}

.map-muted {
    color: var(--text-muted);
}

.map-status-error {
    color: #dc2626;
}

.map-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--sidebar-bg);
    font-size: 0.82rem;
    color: var(--text-main);
}

.map-chip i {
    color: #2563eb;
}

.map-chip-warn {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.map-chip-warn i {
    color: #d97706;
}

.map-layer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.map-legend {
    display: inline-flex;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.map-legend span::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 0.3rem;
    background: var(--dot, #475569);
    vertical-align: middle;
}

#results-map {
    width: 100%;
    height: calc(100vh - 230px);
    min-height: 420px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: var(--sidebar-bg);
    z-index: 0;
}

/* Price pins: the listing's rent on the marker itself */
.map-price-pin {
    background: transparent;
    border: none;
}

.map-price-pin span {
    display: inline-block;
    transform: translate(-50%, -50%);
    padding: 3px 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    font: 600 12px/1.2 'Outfit', sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
    border: 1.5px solid #ffffff;
}

.map-price-pin:hover span {
    background: #2563eb;
}

.map-price-pin.is-approx span {
    background: #64748b;
}

.map-anchor-pin {
    background: transparent;
    border: none;
}

.map-anchor-pin i {
    display: inline-block;
    transform: translate(-50%, -85%);
    font-size: 30px;
    color: #2563eb;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

/* Popup */
.map-pop {
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.map-pop-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.map-pop-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    color: #0f172a;
}

.map-pop-price {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}

.map-pop-specs,
.map-pop-place,
.map-pop-site {
    font-size: 0.82rem;
    color: #64748b;
}

.map-pop-approx {
    color: #d97706;
}

.map-pop-line {
    font-size: 0.82rem;
    color: #0f172a;
}

.map-pop-line i {
    width: 14px;
    color: #2563eb;
}

.map-pop-link {
    margin-top: 0.35rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2563eb !important;
    text-decoration: none;
}

.map-pop-link:hover {
    text-decoration: underline;
}

/* Result cards: nearest metro under the specs */
.card-metro {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-metro i {
    margin-right: 0.4rem;
    color: #2563eb;
}

body.dark-mode .map-price-pin span {
    background: #f8fafc;
    color: #0f172a;
    border-color: #0f172a;
}

body.dark-mode .map-price-pin.is-approx span {
    background: #cbd5e1;
}

@media (max-width: 768px) {
    #results-map {
        height: calc(100vh - 260px);
        min-height: 360px;
        border-radius: 12px;
    }
}
