/**
 * Instant Quote — Address Search Styles
 *
 * @package FliserRent
 * @since   1.2.0
 */

/* ---------- Map Container ---------- */

.iq-map-wrapper {
	margin-top: 1rem;
}

.iq-map {
	width: 100%;
	height: 65vh;
	min-height: 400px;
	max-height: 700px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
	position: relative;
}

/* Placeholder when no API key */
.iq-map-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 400px;
	background: var(--fr-bg-light, #f5f5f5);
	border: 2px dashed var(--fr-border, #dbdbdb);
	border-radius: 12px;
}

/* ---------- Search Bar ---------- */

.iq-search-field {
	position: relative;
	z-index: 10;
}

.iq-search-field .input.is-medium {
	border-radius: 24px 0 0 24px;
	border-right: none;
	font-size: 1.05rem;
	padding-left: 2.8rem;
}

.iq-search-field .button.is-medium {
	border-radius: 0 24px 24px 0;
}

/* ---------- Address Info Bar ---------- */

#iq-address-info {
	border-radius: 10px;
	animation: iqSlideIn 0.3s ease-out;
}

@keyframes iqSlideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- Google Autocomplete Dropdown ---------- */

/* Style the PAC dropdown to match Bulma look */
.pac-container {
	border-radius: 8px;
	border: 1px solid var(--fr-border, #dbdbdb);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	margin-top: 4px;
	font-family: inherit;
	z-index: 10000 !important;
}

.pac-item {
	padding: 0.6rem 1rem;
	font-size: 0.95rem;
	cursor: pointer;
	border-bottom: 1px solid var(--fr-border-light, #f0f0f0);
}

.pac-item:hover {
	background: var(--fr-accent-light, #effaf5);
}

.pac-item-query {
	font-weight: 600;
	color: var(--fr-text, #363636);
}

.pac-matched {
	color: var(--fr-success, #48c78e);
}

/* Hide Google logo in autocomplete (allowed per ToS when map is shown) */
.pac-logo::after {
	display: none;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 768px) {
	.iq-map {
		height: 50vh;
		min-height: 300px;
		border-radius: 8px;
	}

	#iq-address-info .columns {
		flex-direction: column;
		gap: 0.5rem;
	}

	#iq-address-info .column.is-narrow {
		text-align: center;
	}
}

/* ---------- Dark Mode ---------- */

html.dark-mode .iq-map {
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

html.dark-mode .iq-map-placeholder {
	background: var(--fr-bg-dark, #1a1a2e);
	border-color: var(--fr-border-dark, #444);
}

html.dark-mode .pac-container {
	background: var(--fr-bg-dark, #1a1a2e);
	border-color: var(--fr-border-dark, #444);
}

html.dark-mode .pac-item {
	color: var(--fr-text-dark, #e0e0e0);
	border-color: var(--fr-border-dark, #333);
}

html.dark-mode .pac-item:hover {
	background: var(--fr-bg-hover-dark, #2a2a4a);
}

html.dark-mode .pac-item-query {
	color: var(--fr-text-dark, #e0e0e0);
}

/* Auto dark mode (prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
	.iq-map {
		box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
	}
	.iq-map-placeholder {
		background: var(--fr-bg-dark, #1a1a2e);
		border-color: var(--fr-border-dark, #444);
	}
	.pac-container {
		background: var(--fr-bg-dark, #1a1a2e);
		border-color: var(--fr-border-dark, #444);
	}
	.pac-item {
		color: var(--fr-text-dark, #e0e0e0);
		border-color: var(--fr-border-dark, #333);
	}
	.pac-item:hover {
		background: var(--fr-bg-hover-dark, #2a2a4a);
	}
	.pac-item-query {
		color: var(--fr-text-dark, #e0e0e0);
	}
}
