/**
 * Search Form Styles
 * 
 * @package LocationSearchPlugin
 */

/* ====================
   Variables
   ==================== */
:root {
	--lsp-primary: #2563eb;
	--lsp-primary-hover: #1d4ed8;
	--lsp-text: #1f2937;
	--lsp-text-light: #6b7280;
	--lsp-border: #e5e7eb;
	--lsp-background: #ffffff;
	--lsp-background-alt: #f9fafb;
	--lsp-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
	--lsp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--lsp-radius: 8px;
	--lsp-transition: all 0.2s ease;
}

/* Global Reset for Plugin Buttons */
button,
button:hover,
button:active,
button:focus {
	outline: 0 !important;
}

/* ====================
   Search Wrapper
   ==================== */
.lsp-search-wrapper {
	max-width: 900px;
	margin: 2rem auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ====================
   Search Form
   ==================== */
.lsp-search-form {
	background: var(--lsp-background);
	border-radius: var(--lsp-radius);
	box-shadow: var(--lsp-shadow-lg);
	padding: 1.5rem;
}

/* Single Field Search */
.lsp-search-field-wrapper {
	position: relative;
	background: var(--lsp-background-alt);
	border: 2px solid var(--lsp-border);
	border-radius: var(--lsp-radius);
	padding: 0.75rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	transition: var(--lsp-transition);
}

.lsp-search-field-wrapper:focus-within {
	border-color: var(--lsp-primary);
	background: var(--lsp-background);
}

.lsp-tokens-container {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	flex: 0 0 auto;
}

.lsp-token {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--lsp-primary);
	color: white;
	padding: 0.375rem 0.75rem;
	border-radius: 9999px;
	font-size: 0.875rem;
	font-weight: 500;
	animation: tokenSlideIn 0.2s ease;
}

@keyframes tokenSlideIn {
	from {
		opacity: 0;
		transform: scale(0.8);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

.lsp-token-label {
	line-height: 1;
}

.lsp-token-remove {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: white;
	cursor: pointer;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
	padding: 0;
	transition: var(--lsp-transition);
}

.lsp-token-remove:hover {
	background: rgba(255, 255, 255, 0.3);
}

.lsp-search-input {
	flex: 1;
	min-width: 200px;
	border: none;
	background: transparent;
	outline: none;
	font-size: 1rem;
	padding: 0.25rem;
	color: var(--lsp-text);
}

.lsp-search-input::placeholder {
	color: var(--lsp-text-light);
}

/* ====================
   Autocomplete Dropdown
   ==================== */
.lsp-autocomplete-dropdown {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	background: var(--lsp-background);
	border: 1px solid var(--lsp-border);
	border-radius: var(--lsp-radius);
	box-shadow: var(--lsp-shadow-lg);
	max-height: 300px;
	overflow-y: auto;
	z-index: 1000;
	display: none;
}

.lsp-autocomplete-dropdown.lsp-visible {
	display: block;
	animation: dropdownFadeIn 0.2s ease;
}

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

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.lsp-suggestions-list {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0;
}

.lsp-suggestion-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.75rem 1rem;
	cursor: pointer;
	transition: var(--lsp-transition);
}

.lsp-suggestion-item:hover,
.lsp-suggestion-item.lsp-selected {
	background: var(--lsp-background-alt);
}

.lsp-suggestion-label {
	font-size: 0.9375rem;
	color: var(--lsp-text);
}

.lsp-suggestion-badge {
	font-size: 0.75rem;
	color: var(--lsp-text-light);
	background: var(--lsp-background-alt);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: 0.5px;
}

/* ====================
   Submit Button
   ==================== */
.lsp-search-submit {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--lsp-primary);
	color: white;
	border: none;
	border-radius: var(--lsp-radius);
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--lsp-transition);
	margin-top: 1rem;
	width: 100%;
}

.lsp-search-submit:hover {
	background: var(--lsp-primary-hover);
	transform: translateY(-1px);
	box-shadow: var(--lsp-shadow-lg);
}

.lsp-search-submit:active {
	transform: translateY(0);
}

/* ====================
   Advanced Form
   ==================== */
.lsp-advanced-form .lsp-search-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}

.lsp-field-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.lsp-field-group label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--lsp-text);
}

.lsp-field-group input,
.lsp-field-group select {
	padding: 0.75rem;
	border: 1px solid var(--lsp-border);
	border-radius: var(--lsp-radius);
	font-size: 0.9375rem;
	background: var(--lsp-background);
	color: var(--lsp-text);
	transition: var(--lsp-transition);
}

.lsp-field-group input:focus,
.lsp-field-group select:focus {
	outline: none;
	border-color: var(--lsp-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ====================
   Results
   ==================== */
.lsp-search-results {
	margin-top: 2rem;
}

.lsp-results-header h3 {
	font-size: 1.5rem;
	color: var(--lsp-text);
	margin: 0 0 1.5rem 0;
}

.lsp-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}

.lsp-location-card {
	background: var(--lsp-background);
	border-radius: var(--lsp-radius);
	overflow: hidden;
	box-shadow: var(--lsp-shadow);
	transition: var(--lsp-transition);
}

.lsp-location-card:hover {
	box-shadow: var(--lsp-shadow-lg);
	transform: translateY(-2px);
}

.lsp-card-image {
	width: 100%;
	height: 200px;
	background-size: cover;
	background-position: center;
	background-color: var(--lsp-background-alt);
}

.lsp-card-content {
	padding: 1.25rem;
}

.lsp-card-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--lsp-text);
	margin: 0 0 0.75rem 0;
}

.lsp-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.lsp-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.875rem;
	color: var(--lsp-text-light);
}

.lsp-card-excerpt {
	font-size: 0.9375rem;
	color: var(--lsp-text-light);
	line-height: 1.6;
	margin: 0 0 1rem 0;
}

.lsp-card-link {
	display: inline-block;
	color: var(--lsp-primary);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
	transition: var(--lsp-transition);
}

.lsp-card-link:hover {
	color: var(--lsp-primary-hover);
}

/* Favorites Button */
button.lsp-favorite-btn {
	position: absolute;
	right: 0.8rem;
	top: 0.8rem;
	border: 0;
	background: none;
	color: white;
	padding: 0;
	font-size: 1.2rem;
	z-index: 2;
	cursor: pointer;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
	transition: transform 0.2s;
}

button.lsp-favorite-btn:hover {
	transform: scale(1.1);
}

.lsp-card-image-wrapper {
	position: relative;
	display: block;
	overflow: hidden;
}



.lsp-error {
	color: #dc2626;
}

/* ====================
   Pagination
   ==================== */
.lsp-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
}

.lsp-pagination button {
	background: var(--lsp-background);
	border: 1px solid var(--lsp-border);
	color: var(--lsp-text);
	padding: 0.5rem 1rem;
	border-radius: var(--lsp-radius);
	cursor: pointer;
	transition: var(--lsp-transition);
	font-weight: 500;
}

.lsp-pagination button:hover {
	background: var(--lsp-background-alt);
	border-color: var(--lsp-primary);
}

/* ====================
   Responsive
   ==================== */
@media (max-width: 768px) {
	.lsp-search-wrapper {
		margin: 1rem;
	}

	.lsp-search-form {
		padding: 1rem;
	}

	.lsp-results-grid {
		grid-template-columns: 1fr;
	}

	.lsp-advanced-form .lsp-search-fields {
		grid-template-columns: 1fr;
	}
}

/* ====================
   Tooltips (Overlay)
   ==================== */
.lsp-location-card {
	position: relative;
	/* Ensure absolute children are positioned relative to card */
}

.lsp-tooltip {
	position: fixed;
	/* Fixed relative to viewport to follow mouse easily */
	top: 0;
	left: 0;
	width: 300px;
	/* Fixed width */
	height: auto;
	/* Auto height */
	background: rgba(0, 0, 0, 0.95);
	color: #fff;
	/* opacity/visibility handled here, but since we append/remove triggers, we can default to visible or animate in */
	opacity: 0;
	animation: fadeIn 0.2s forwards;

	display: flex;
	flex-direction: column;
	text-align: left;
	/* Reset text align */
	padding: 0;
	/* Let children handle padding */
	z-index: 99999;
	/* Very high z-index */
	backdrop-filter: blur(4px);
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
	pointer-events: none;
	/* Ignore mouse events so it doesn't flicker under cursor */
	overflow: hidden;
}

@keyframes fadeIn {
	to {
		opacity: 1;
	}
}

.lsp-tooltip-gallery {
	width: 100%;
	height: 150px;
	overflow: hidden;
	background: #333;
}

.lsp-tooltip-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lsp-tooltip-content {
	padding: 1rem;
	width: calc(100% - 2rem);
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.lsp-tooltip-content h5 {
	margin: 0;
	font-size: 1.1rem;
	color: #fff;
	font-weight: 700;
}


.lsp-tooltip-location {
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.8);
	margin: 0;
}

.lsp-tooltip-desc {
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.7);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0.5rem 0;
}

.lsp-tooltip-meta {
	display: flex;
	justify-content: center;
	gap: 1rem;
	margin-top: 0.5rem;
}

.lsp-tooltip-meta span {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
}

/* Hide the ID that looks like a phone number */
.lsp-card-id {
	display: none;
}

/* Category Bar List */
.lsp-category-list-container {
	flex: 1;
	overflow: hidden;
	position: relative;
	margin: 0 1rem;
}

.lsp-category-list {
	display: flex !important;
	gap: 2.5rem;
	overflow-x: auto;
	scroll-behavior: smooth;
	padding: 1rem 0;
	margin: 0 !important;
	list-style: none !important;
	/* Force remove bullets */
	scrollbar-width: none;
	/* Firefox */
}

.lsp-category-list::-webkit-scrollbar {
	display: none;
	/* Chrome/Safari */
}

.lsp-category-item {
	flex: 0 0 auto;
	margin: 0 !important;
	list-style: none !important;
}

.lsp-category-btn {
	background: none;
	border: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	cursor: pointer;
	color: #666;
	transition: all 0.2s;
	opacity: 0.8;
	padding: 0;
}

.lsp-category-btn:hover,
.lsp-category-btn.active {
	color: #111;
	opacity: 1;
}

.lsp-category-btn.active {
	/* border-bottom: 2px solid #111; Optional underline active state */
	color: #000;
	font-weight: 700;
}

.lsp-category-btn.active .lsp-cat-icon {
	color: #c0392b;
	/* Active Red */
	transform: scale(1.1);
}

.lsp-category-btn.active .lsp-cat-name {
	color: #111;
	font-weight: 700;
}

.lsp-cat-icon {
	font-size: 1.8rem;
	/* Larger Icons */
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s, transform 0.2s;
	color: #444;
}

.lsp-cat-name {
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
}

.lsp-cat-nav-btn {
	appearance: none;
	/* Reset native appearance */
	-webkit-appearance: none;
	background: #fff;
	border: 1px solid #e5e7eb;
	width: 40px;
	/* Slightly larger */
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #374151;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	flex-shrink: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	padding: 0;
	/* Reset padding */
	margin: 0;
	/* Reset margin */
	font-size: 1rem;
	z-index: 2;
	/* Ensure above scroll */
}

.lsp-cat-nav-btn:hover:not(:disabled) {
	border-color: #d1d5db;
	background: #f9fafb;
	color: #111;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.lsp-cat-nav-btn:active:not(:disabled) {
	transform: translateY(0);
}

.lsp-cat-nav-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	background: #f3f4f6;
	border-color: #f3f4f6;
	box-shadow: none;
}

/* Filter Trigger Button (in Category Bar) */
.lsp-category-bar-wrapper {
	display: flex;
	align-items: center;
	gap: 1rem;
	position: relative;
	max-width: 1200px;
	margin: 0 auto 2rem auto;
}

.lsp-category-bar {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	/* Prevent flex item from overflowing */
}

.lsp-filter-trigger {
	width: 45px;
	height: 45px;
	border-radius: 50%;
	background: #c0392b;
	/* Reddish/Orange */
	color: #fff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	cursor: pointer;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	transition: background 0.2s, transform 0.2s;
	flex-shrink: 0;
	/* Don't shrink */
}

.lsp-filter-trigger:hover {
	background: #a93226;
	transform: translateY(-2px);
}

/* Modal Styles */
.lsp-modal {
	display: none;
	/* Hidden by default */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	justify-content: center;
	align-items: center;
	font-family: 'Inter', sans-serif;
}

.lsp-modal.is-open {
	display: flex;
}

.lsp-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(2px);
}

.lsp-modal-container {
	background: #fff;
	width: 90%;
	max-width: 800px;
	max-height: 90vh;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	position: relative;
	z-index: 10001;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.lsp-modal-header {
	padding: 1.5rem 2rem;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.lsp-modal-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: #111;
	margin: 0;
}

.lsp-modal-close {
	background: none;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
	color: #666;
	padding: 0.5rem;
}

.lsp-modal-content {
	padding: 2rem;
	overflow-y: auto;
}

.lsp-modal-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	margin-bottom: 1.5rem;
}

.lsp-modal-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.lsp-modal-group label {
	font-weight: 700;
	font-size: 0.95rem;
	color: #333;
}

.lsp-modal-input,
.lsp-modal-select {
	padding: 0.8rem 1rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 1rem;
	color: #555;
	outline: none;
}

.lsp-modal-input:focus,
.lsp-modal-select:focus {
	border-color: #333;
}

/* Styles Grid */
.lsp-styles-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	max-height: 200px;
	overflow-y: auto;
	padding-right: 0.5rem;
}

.lsp-style-checkbox {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	cursor: pointer;
	font-size: 0.95rem;
	color: #444;
}

.lsp-style-checkbox input[type="checkbox"] {
	width: 1.2rem;
	height: 1.2rem;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
}

/* Scrollbar styling for grids */
.lsp-styles-grid::-webkit-scrollbar {
	width: 6px;
}

.lsp-styles-grid::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.lsp-styles-grid::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

.lsp-modal-footer {
	padding: 1.5rem 2rem;
	border-top: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #fcfcfc;
}

.lsp-btn-reset {
	background: none;
	border: none;
	color: #666;
	font-size: 0.95rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: underline;
}

.lsp-btn-submit {
	background: #c0392b;
	color: #fff;
	border: none;
	padding: 1rem 2rem;
	border-radius: 6px;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.2s;
}

.lsp-btn-submit:hover {
	background: #a93226;
}

/* Responsive Modal */
@media (max-width: 768px) {
	.lsp-modal-row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.lsp-styles-grid {
		grid-template-columns: 1fr;
	}
}

/* Responsive Adjustments */
@media (max-width: 768px) {
	.lsp-modal-content {
		padding: 1.5rem;
	}

	.lsp-modal-row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	/* Mobile Category Bar: Hide list, center filter button */
	.lsp-category-bar>.lsp-category-list-container,
	.lsp-category-bar>.lsp-cat-nav-btn {
		display: none !important;
	}

	.lsp-category-bar-wrapper {
		justify-content: center;
		margin: 2rem auto;
		/* Center the remaining content */
	}

	.lsp-category-bar {
		flex: 0 0 auto;
		/* Stop taking up all space */
		width: auto;
	}

	.lsp-filter-trigger {
		margin-left: 0;
		/* Remove auto margin */
		width: 48px;
		height: 48px;
		font-size: 1.2rem;
	}

	/* Disable Tooltips on Mobile */
	.lsp-tooltip {
		display: none !important;
	}
}