/* Searchable Dropdown Complete Styles - Structural CSS Only */

/* All visual styles (colors, borders, padding, fonts) are applied dynamically via PHP from Customize settings */

/* ============= WRAPPER & INPUT ============= */
.searchable-dropdown-wrapper {
	position: relative;
	width: 100%;
	z-index: auto;
}

/* Ensure form containers don't clip dropdowns */
.auto-form-builder-form {
	overflow: visible !important;
}

.form-field {
	overflow: visible !important;
}

.auto-form-builder-wrapper .form-field {
	overflow: visible !important;
}

/* Ensure field containers don't clip dropdowns */
.form-row {
	overflow: visible !important;
}

.field-container {
	overflow: visible !important;
}

/* Force visibility for any parent containers that might clip dropdowns */
.auto-form-builder-wrapper,
.auto-form-builder-wrapper .auto-form-builder-form,
.auto-form-builder-wrapper .form-field,
.auto-form-builder-wrapper .form-row,
.auto-form-builder-wrapper .field-container,
.auto-form-builder-wrapper .searchable-dropdown-wrapper {
	overflow: visible !important;
}

/* Ensure WordPress theme containers don't interfere */
.entry-content .auto-form-builder-wrapper,
.post-content .auto-form-builder-wrapper,
.page-content .auto-form-builder-wrapper,
.content .auto-form-builder-wrapper {
	overflow: visible !important;
}

/* Searchable dropdown input structure */
.searchable-dropdown-input {
	width: 100%;
	height: 42px;
	padding-right: 40px; /* Space for dropdown arrow */
	transition: all 0.3s ease;
	box-sizing: border-box;
	line-height: 1.5;
	outline: none;
	position: relative;
	z-index: 2;

	/* All visual styles (padding, border, border-radius, font-size, color, background, box-shadow, font-family) set dynamically */
}

/* Input cursor states */
.searchable-dropdown-input.searchable {
	cursor: text;
}

.searchable-dropdown-input.non-searchable {
	cursor: pointer;
}

/* Focus state structure - visual styles set dynamically */
.searchable-dropdown-input:focus {
	outline: none;

	/* border-color and box-shadow set dynamically */
}

/* ============= DROPDOWN ARROW ============= */
.dropdown-arrow {
	position: absolute;
	right: 14px;
	top: 30%;
	transform: translateY(-50%);
	pointer-events: none;
	font-size: 12px;
	opacity: 0.6;
	z-index: 10;
	line-height: 1;

	/* Color applied dynamically from inputColor setting */
}

/* ============= SELECTED VALUES DISPLAY ============= */
.selected-values-display {
	position: absolute;
	top: 1px;
	left: 1px;
	right: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	pointer-events: none;
	padding: 0 13px;
	line-height: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	z-index: 1000;
	color: #666;

	/* All visual styles (background, font-size, border-radius, font-family, box-shadow) set dynamically */
}

/* ============= DROPDOWN OPTIONS ============= */
.searchable-dropdown-options {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	border-top: none;
	max-height: 240px; /* Default max-height, overridden by JavaScript for smart positioning */
	overflow-y: auto;
	z-index: 9999;
	display: none;
	box-shadow: 0 8px 16px rgb(0 0 0 / 15%);
	margin: 0;
	margin-top: -1px;
	background: #fff; /* Default background, can be overridden dynamically */

	/* Smart positioning styles are applied dynamically by JavaScript */

	/* Other visual styles (border, border-radius) set dynamically */
}

/* When positioned above the input */
.searchable-dropdown-options.dropdown-above {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: -1px;
	box-shadow: 0 -8px 16px rgb(0 0 0 / 15%);
}

/* Dropdown option checkboxes */
.searchable-dropdown-options .dropdown-option input[type="checkbox"] {
	margin-right: 8px;

	/* Spacing between checkbox and option text */
}

/* Individual dropdown option structure */
.searchable-dropdown-options .dropdown-option {
	cursor: pointer;
	border-bottom: 1px solid #f0f0f1;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	font-weight: 400;
	line-height: 1.4;

	/* All visual styles (padding, font-size, color, background-color) set dynamically */
}

.searchable-dropdown-options .dropdown-option.hidden {
	display: none;
}

.searchable-dropdown-options .dropdown-option:hover {
	background-color: #f8f9fa;
}

.searchable-dropdown-options .dropdown-option.selected {
	background-color: #e3f2fd;
	font-weight: 600;

	/* Color set dynamically */
}

.searchable-dropdown-options .dropdown-option:last-child {
	border-bottom: none;
}

/* No options available message */
.dropdown-no-options {
	padding: 8px 12px;
	color: #999;
	font-style: italic;
}

/* ============= SELECTED CHIPS ============= */
.selected-chips-container {
	margin-top: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

/* Individual selected chip structure */
.selected-chips-container .selected-chip {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	margin: 2px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;

	/* All visual styles (background-color, border, color) set dynamically using primaryColor */
}

/* Chip remove button styling */
.chip-remove-btn {
	margin-left: 4px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.chip-remove-btn:hover {
	opacity: 1;
}
