/* Lakeside Lot Map */

/* Match the site branding (schillingdevelopment.com): Poppins type + the
   blue->navy .fl-button used across the theme. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

.lsm-map-wrap {
	position: relative;
	background: #fff;
	border-radius: 8px;
	/* Brand tokens — buttons/links inside the map (popups + legend) inherit these. */
	--lsm-brand: #1971b5;       /* primary button blue */
	--lsm-brand-dark: #1b335c;  /* navy (button hover) */
	--lsm-accent: #a01231;      /* crimson accent */
	--lsm-ink: #414042;         /* body/heading ink */
	--lsm-font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lsm-map {
	width: 100%;
	background: #fff;
	border-radius: 8px;
	z-index: 0;
}

/* ---------------- Loading spinner ---------------- */

.lsm-loading {
	position: absolute;
	inset: 0;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(233, 239, 228, 0.6);
	border-radius: 8px;
	transition: opacity 0.3s;
	pointer-events: none;
}

.lsm-loading--done {
	opacity: 0;
	visibility: hidden;
}

.lsm-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid rgba(46, 125, 50, 0.25);
	border-top-color: #2e7d32;
	border-radius: 50%;
	animation: lsm-spin 0.8s linear infinite;
}

@keyframes lsm-spin {
	to { transform: rotate(360deg); }
}

/* ---------------- Pins ---------------- */

.lsm-pin-anchor {
	background: none;
	border: none;
}

.lsm-pin {
	--lsm-size: 30px;
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
	width: var(--lsm-size);
	height: var(--lsm-size);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font: 700 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #fff;
	border: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	box-sizing: border-box;
	transition: width 0.15s, height 0.15s;
	cursor: pointer;
}

.lsm-pin--open      { background: #2e7d32; }
.lsm-pin--schilling { background: #1971b5; }
.lsm-pin--builder   { background: #7fb8e0; }
.lsm-pin--pending   { background: #f2b705; color: #3d3000; }
.lsm-pin--sold      { background: #9aa0a6; }
.lsm-pin--none      { background: #9aa0a6; }

.lsm-pin--open:hover { background: #1b5e20; }

/* Zoom bands: dots when far out, numbered badges up close */
.lsm-map[data-lsm-band="far"] .lsm-pin {
	--lsm-size: 10px;
	border-width: 1px;
}

.lsm-map[data-lsm-band="far"] .lsm-pin span {
	display: none;
}

.lsm-map[data-lsm-band="mid"] .lsm-pin {
	--lsm-size: 18px;
	font-size: 8px;
}

.lsm-map[data-lsm-band="near"] .lsm-pin {
	--lsm-size: 32px;
}

/* ---------------- Lot parcels (GIS-style fill overlay) ---------------- */

/* Fill / stroke / opacity / weight ALL come from JS as SVG presentation
   attributes (Leaflet setStyle). Deliberately NO CSS transition here: when a
   transition is declared on a property whose value comes from a presentation
   attribute, Chrome stops reflecting later setAttribute changes into the
   rendered value — which silently broke hover and the filter's grey-muting.
   Transition-free = every setStyle update applies. */

.lsm-lot--assigned {
	cursor: pointer;
}

/* Unassigned + sold parcels open no popup, so override Leaflet's default
   interactive pointer cursor — only builder-assigned, non-sold lots read as
   clickable. Sold lots are grayed-out, inert context (like the Preserve plugin). */
.lsm-lot--none,
.lsm-lot--sold {
	cursor: default;
}

/* Flat lot-number label centered on the parcel; clicks fall through. */
.lsm-lot-label {
	background: none;
	border: none;
	pointer-events: none;
}

.lsm-lot-label span {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
	white-space: nowrap;
	font: 700 12px/1 Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #fff;
	text-shadow: 0 0 2px rgba(0, 0, 0, 0.85), 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Match the pin zoom bands: hide numbers when far out, scale up close. */
.lsm-map[data-lsm-band="far"] .lsm-lot-label {
	display: none;
}

.lsm-map[data-lsm-band="mid"] .lsm-lot-label span {
	font-size: 9px;
}

.lsm-map[data-lsm-band="near"] .lsm-lot-label span {
	font-size: 13px;
}

/* Builder logo badge on a lot (shown when the builder has a logoUrl, in place
   of the lot number). Centered on the parcel; clicks fall through. */
.lsm-logo {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
	max-width: 44px;
	max-height: 24px;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.lsm-map[data-lsm-band="far"] .lsm-lot-label--logo { display: none; }
.lsm-map[data-lsm-band="mid"] .lsm-logo { max-width: 30px; max-height: 16px; }

/* Builder popup card */
.lsm-card-builder {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 2px 0 4px;
	font-weight: 700;
}
.lsm-card-logo { max-width: 56px; max-height: 30px; }
.lsm-card-bname { font-size: 14px; }
.lsm-legend-logo { max-width: 40px; max-height: 16px; vertical-align: middle; }

/* Status chip + per-lot custom popup content */
.lsm-card-status { margin: 2px 0 4px; }
.lsm-chip {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font: 700 11px/1.5 Poppins, -apple-system, sans-serif;
	color: #fff;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.lsm-card-custom {
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--lsm-ink, #414042);
}
.lsm-card-custom p { margin: 0 0 6px; }

/* ---------------- Site-plan basemap ---------------- */

/* The vector "Site plan" base is the default. Its land/road/water/common fills
   come from JS; here we only set the neutral page behind them so the area
   OUTSIDE the development reads as blank canvas (not white tiles). When a tile
   base (Aerial/Streets) is selected, the class is removed and the tiles cover
   the canvas again. */
.lsm-map.lsm-base-siteplan,
.lsm-map.lsm-base-siteplan .leaflet-container {
	background: #f6f7f4;
}

/* Rotated street-name label sitting on the road ribbons. Dark ink (roads are
   light), centered + rotated via the inline transform set in JS. */
.lsm-street-label {
	background: none;
	border: none;
	pointer-events: none;
}

.lsm-street-label span {
	position: absolute;
	left: 0;
	top: 0;
	white-space: nowrap;
	font: 600 11px/1 Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: 0.04em;
	color: #5b6b50;
	text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}

/* Match the lot-number zoom bands: hide street names when far out. */
.lsm-map[data-lsm-band="far"] .lsm-street-label {
	display: none;
}

.lsm-map[data-lsm-band="mid"] .lsm-street-label span {
	font-size: 9px;
}

/* ---------------- Popup card ---------------- */

.lsm-popup .leaflet-popup-content {
	margin: 0;
	width: 250px !important;
}

.lsm-popup .leaflet-popup-content-wrapper {
	padding: 0;
	overflow: hidden;
	border-radius: 10px;
}

.lsm-card-thumb img {
	display: block;
	width: 100%;
	height: 130px;
	object-fit: cover;
}

.lsm-card-body {
	padding: 12px 14px 14px;
	font-family: var(--lsm-font);
	color: var(--lsm-ink);
}

.lsm-card-title {
	font-family: var(--lsm-font);
	font-size: 18px;
	font-weight: 700;
	color: var(--lsm-brand-dark);
	margin-bottom: 4px;
}

.lsm-card-features {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 14px;
	color: #6b6b6d;
	margin: 5px 0 0;
}
.lsm-card-features a {
	color: inherit;
	text-decoration: none;
	/* Let a long email shrink + wrap inside the fixed-width popup instead of
	   overflowing (min-width:0 frees the flex item; break-word wraps the address). */
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.lsm-card-features a:hover { text-decoration: underline; }
.lsm-ico {
	width: 14px;
	height: 14px;
	fill: currentColor;
	flex: none;
	margin-top: 2px;
}

.lsm-card-btn {
	display: block;
	margin-top: 10px;
	padding: 10px 12px;
	background: var(--lsm-brand);
	color: #fff !important;
	text-align: center;
	border-radius: 4px;
	font-family: var(--lsm-font);
	font-weight: 700;
	font-size: 15px;
	text-transform: capitalize;
	text-decoration: none !important;
	transition: background 0.15s;
}

.lsm-card-btn:hover {
	background: var(--lsm-brand-dark);
}

.lsm-card-btn .lsm-ico-ext {
	width: 15px;
	height: 15px;
	margin-left: 7px;
	fill: currentColor;
	vertical-align: -2px;
}

/* ---------------- Chips / legend ---------------- */

.lsm-chip {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* The popup status badge (e.g. "Contact Developer" / "Contact Builder" /
   "Spec House") uses the site's brand blue, white text — not the green
   availability color. */
.lsm-chip-open    { background: var(--lsm-brand); }
.lsm-chip-pending { background: #f2b705; color: #3d3000; }
.lsm-chip-sold    { background: #c62828; }

.lsm-legend {
	background: rgba(255, 255, 255, 0.94);
	border-radius: 8px;
	padding: 7px 12px;
	font-family: var(--lsm-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	color: var(--lsm-ink);
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-wrap: nowrap;
	white-space: nowrap;
	gap: 6px 14px;
	align-items: center;
}

/* Builder color key + the static Sold swatch — kept on a SINGLE line. */
.lsm-legend-key {
	display: inline-flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 4px 12px;
}

.lsm-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.lsm-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	display: inline-block;
}

/* Styled to match the site's .fl-button (Poppins 700, blue -> navy on hover). */
.lsm-legend-link {
	display: inline-block;
	margin-left: 2px;
	padding: 5px 12px;
	background: var(--lsm-brand);
	color: #fff !important;
	font-family: var(--lsm-font);
	font-weight: 700;
	font-size: 11px;
	line-height: 1.4;
	text-transform: capitalize;
	text-decoration: none !important;
	border-radius: 4px;
	transition: background 0.15s;
}

.lsm-legend-link:hover {
	background: var(--lsm-brand-dark);
	color: #fff !important;
}

/* "Show:" prefix so it's clear the chips are filter controls. */
.lsm-legend-label {
	font-family: var(--lsm-font);
	font-size: 12px;
	font-weight: 700;
	color: var(--lsm-ink);
	margin-right: 1px;
}

/* Filter rows: a checkbox + color dot + status label. */
.lsm-filter {
	margin: 0;
	padding: 3px 4px;
	display: flex;
	align-items: center;
	gap: 7px;
	font-family: var(--lsm-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--lsm-ink);
	cursor: pointer;
}

.lsm-filter:hover { color: var(--lsm-brand); }

.lsm-filter-cb {
	margin: 0;
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
	accent-color: var(--lsm-brand);
	cursor: pointer;
}

/* ---- Top-right action bar: Export Map (left) + Filter dropdown (right) ---- */
.lsm-filterbox {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--lsm-font);
}

/* Relative wrapper so the dropdown panel anchors under the Filter toggle only. */
.lsm-filter-wrap { position: relative; }

/* The Export Map button next to Filter: match the toggle's height/weight. */
.lsm-filterbox .lsm-export {
	margin-left: 0;
	padding: 7px 14px;
	font-size: 13px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}

.lsm-filter-toggle {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	background: rgba(255, 255, 255, 0.95);
	border: 0;
	border-radius: 8px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
	font-family: var(--lsm-font);
	font-size: 13px;
	font-weight: 700;
	color: var(--lsm-ink);
	cursor: pointer;
}

.lsm-filter-toggle:hover { color: var(--lsm-brand); }
.lsm-filterbox.is-open .lsm-caret { transform: rotate(180deg); }
.lsm-caret { display: inline-block; transition: transform 0.15s; font-size: 10px; }

/* The panel drops down below the button, right-aligned. */
.lsm-filter-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 168px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px;
	background: rgba(255, 255, 255, 0.98);
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lsm-filter-panel[hidden] { display: none; }

.lsm-filter-panel-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7178;
	margin-bottom: 2px;
}

/* Stack the status toggles full-width inside the panel. */
.lsm-filter-panel .lsm-filter {
	width: 100%;
	justify-content: flex-start;
	border-radius: 6px;
}

/* "Export PDF" reuses the blue button look; it's a <button>, so clear chrome. */
.lsm-export {
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	cursor: pointer;
}

.lsm-export[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* "All Listings" as a lighter outline button so the primary Export stands out. */
.lsm-legend-link--ghost {
	background: #fff;
	color: var(--lsm-brand) !important;
	border: 1px solid var(--lsm-brand);
}

.lsm-legend-link--ghost:hover {
	background: #eef4fa;
	color: var(--lsm-brand-dark) !important;
}

/* Per-property-status filters: toggling a status OFF greys out its parcels (kept
   visible as context) and makes them inert — pointer-events:none drops the
   popup/hover, like sold/unlisted lots. The CSS color/stroke override beats
   Leaflet's inline SVG presentation attributes. Lot-number labels are NOT
   hidden — every lot keeps its number. Sold + unlisted have no toggle. */
.lsm-map.lsm-hide-s--construction-ready .lsm-lot-s--construction-ready,
.lsm-map.lsm-hide-s--contact-builder .lsm-lot-s--contact-builder,
.lsm-map.lsm-hide-s--spec .lsm-lot-s--spec,
.lsm-map.lsm-hide-s--pending .lsm-lot-s--pending {
	/* The grey recolor + muted opacity/weight are applied in JS (setFilter →
	   muteFilteredParcels) via Leaflet setStyle. CSS only makes the filtered lot
	   inert — pointer-events isn't a presentation attribute, so this is reliable. */
	pointer-events: none !important;
	cursor: default !important;
}

/* Transient message (export errors / not-ready), centered over the map. */
.lsm-toast {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translate(-50%, 8px);
	z-index: 1200;
	max-width: 80%;
	background: rgba(27, 51, 92, 0.95);
	color: #fff;
	font-family: var(--lsm-font);
	font-size: 13px;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
}

.lsm-toast--show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------------- Admin editor ---------------- */

.lsm-editor {
	display: flex;
	gap: 16px;
	align-items: stretch;
	margin-top: 10px;
}

.lsm-admin-map {
	flex: 1;
	min-width: 0;
	height: 750px;
	border: 1px solid #c3c4c7;
}

.lsm-editor-side {
	width: 290px;
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: 750px;
	overflow-y: auto;
}

.lsm-side-box {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 10px 12px;
}

.lsm-side-row {
	display: flex;
	gap: 6px;
	margin-top: 6px;
}

.lsm-side-row input {
	flex: 1;
}

.lsm-queue {
	margin: 8px 0 0;
	max-height: 200px;
	overflow-y: auto;
	border-top: 1px solid #eee;
}

.lsm-queue li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 4px 6px;
	margin: 0;
	border-bottom: 1px solid #f0f0f1;
	cursor: pointer;
	font-size: 13px;
}

.lsm-queue li:hover {
	background: #f0f6fc;
}

.lsm-queue li.lsm-selected {
	background: #2271b1;
	color: #fff;
}

.lsm-armed {
	margin-top: 8px;
	padding: 7px 10px;
	background: #fff8e5;
	border: 1px solid #dba617;
	border-radius: 4px;
	font-weight: 600;
}

.lsm-save-status {
	margin-left: 8px;
	font-weight: 600;
}

.lsm-save-status.ok    { color: #00a32a; }
.lsm-save-status.err   { color: #d63638; }
.lsm-save-status.dirty { color: #996800; }

@media (max-width: 1100px) {
	.lsm-editor {
		flex-direction: column;
	}

	.lsm-editor-side {
		width: auto;
		max-height: none;
	}
}
