/**
 * MLS Genie™ — Frontend Draw Search
 * Styles for the Draw Search button, mode banner, and results panel.
 * All selectors scoped to mlsg-fdr- prefix. No !important.
 *
 * @since 1.7.776
 */

/* ── Draw button (appended to .map-arrows-actions, after Layers) ──────────── */
/* map-btn class (Houzez) provides: dark bg, white text, 30px height, border-radius 4px. */
/* mlsg-fdr-btn is our modifier — handles active state only.                             */

.mlsg-fdr-btn {
	display: block;
	margin-top: 4px;
	white-space: nowrap;
}

.mlsg-fdr-btn--active {
	background: #107dbd;
}

.mlsg-fdr-btn--active:hover {
	background: #0d6fa8;
}

/* ── Mode banner (top of map, full width) ──────────────────────────────────── */

.mlsg-fdr-banner {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	background: rgba(26, 26, 46, 0.9);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	backdrop-filter: blur(4px);
	transition: opacity 0.2s, transform 0.2s;
}

.mlsg-fdr-banner--hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateY(-100%);
}

.mlsg-fdr-banner__text {
	flex: 1;
}

.mlsg-fdr-banner__cancel {
	background: transparent;
	border: 1.5px solid rgba(255,255,255,.5);
	color: #fff;
	padding: 4px 14px;
	border-radius: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	font-family: inherit;
}

.mlsg-fdr-banner__cancel:hover {
	background: rgba(255,255,255,.15);
	border-color: #fff;
}

/* ── Results panel (slides in from right) ──────────────────────────────────── */

.mlsg-fdr-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: 360px;
	max-width: 100vw;
	height: 100vh;
	background: #fff;
	box-shadow: -4px 0 24px rgba(0,0,0,.15);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.mlsg-fdr-panel--open {
	transform: translateX(0);
}

.mlsg-fdr-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid #e5e7eb;
	background: #f8fafc;
	flex-shrink: 0;
}

.mlsg-fdr-panel__count {
	font-size: 0.9375rem;
	font-weight: 700;
	color: #1a1a2e;
}

.mlsg-fdr-panel__close {
	background: transparent;
	border: none;
	color: #6b7280;
	font-size: 1.25rem;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	line-height: 1;
	transition: color 0.15s, background 0.15s;
	font-family: inherit;
}

.mlsg-fdr-panel__close:hover {
	color: #1a1a2e;
	background: #f1f5f9;
}

.mlsg-fdr-panel__body {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
}

/* ── Loading state ─────────────────────────────────────────────────────────── */

.mlsg-fdr-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 48px 20px;
	color: #6b7280;
	font-size: 0.875rem;
}

.mlsg-fdr-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #e5e7eb;
	border-top-color: #107dbd;
	border-radius: 50%;
	animation: mlsg-fdr-spin 0.7s linear infinite;
}

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

/* ── Empty / error state ───────────────────────────────────────────────────── */

.mlsg-fdr-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 48px 20px;
	color: #9ca3af;
	text-align: center;
}

.mlsg-fdr-empty i {
	font-size: 2rem;
	opacity: 0.4;
}

.mlsg-fdr-empty p {
	font-size: 0.875rem;
	margin: 0;
	line-height: 1.5;
}

/* ── Property cards ─────────────────────────────────────────────────────────── */

.mlsg-fdr-card {
	display: flex;
	gap: 10px;
	padding: 10px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	margin-bottom: 8px;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.mlsg-fdr-card:hover {
	border-color: #107dbd;
	box-shadow: 0 2px 8px rgba(16,125,189,.12);
}

.mlsg-fdr-card__photo {
	width: 72px;
	height: 72px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f1f5f9;
}

.mlsg-fdr-card__photo--placeholder {
	width: 72px;
	height: 72px;
	border-radius: 6px;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #d1d5db;
	font-size: 1.25rem;
}

.mlsg-fdr-card__body {
	flex: 1;
	min-width: 0;
}

.mlsg-fdr-card__price {
	font-size: 1rem;
	font-weight: 700;
	color: #1a1a2e;
	margin: 0 0 3px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.mlsg-fdr-card__address {
	font-size: 0.75rem;
	color: #6b7280;
	margin: 0 0 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mlsg-fdr-card__meta {
	font-size: 0.75rem;
	color: #374151;
	margin: 0;
	display: flex;
	gap: 8px;
}

.mlsg-fdr-card__status {
	display: inline-block;
	font-size: 0.6875rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.mlsg-fdr-card__status--active  { background: #dcfce7; color: #166534; }
.mlsg-fdr-card__status--pending { background: #fef9c3; color: #854d0e; }
.mlsg-fdr-card__status--closed  { background: #f1f5f9; color: #475569; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
	.mlsg-fdr-panel {
		width: 100vw;
	}
}
