/* -------------------------------------------------
 * Layout
 * ------------------------------------------------- */

.acf-workout-exercise-selector {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Filters */
.acf-wes__filters {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 8px;
	align-items: stretch;
}

.acf-wes__filter {
	display: flex;
	flex-direction: column;
}

.acf-wes__search-wrap {
	margin-top: 6px;
}

.acf-wes__search {
	max-width: 400px;
}

/* Results + Selected columns */
.acf-wes__columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* -------------------------------------------------
 * Containers
 * ------------------------------------------------- */

.acf-wes__results,
.acf-wes__selected {
	border: 1px solid #ddd;
	padding: 6px;
	min-height: 120px;
	background: #fff;
}

/* ✅ LIMIT SEARCH RESULTS HEIGHT */
.acf-wes__results {
	max-height: 250px;
	overflow-y: auto;
}

/* Scrollbar polish */
.acf-wes__results::-webkit-scrollbar {
	width: 8px;
}

.acf-wes__results::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 4px;
}

/* -------------------------------------------------
 * Post rows
 * ------------------------------------------------- */

.acf-wes__result,
.acf-wes__selected-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 4px 2px;
	cursor: pointer;
	border-radius: 2px;
}

/* Subtle separator */
.acf-wes__result:not(:last-child),
.acf-wes__selected-item:not(:last-child) {
	border-bottom: 1px solid #eee;
}

.acf-wes__result:hover,
.acf-wes__selected-item:hover {
	background: #f6f7f7;
}

/* Already selected (subtle) */
.acf-wes__result.is-selected {
	opacity: 0.55;
}

/* -------------------------------------------------
 * Thumbnail handling
 * ------------------------------------------------- */

.acf-wes__result img,
.acf-wes__selected-item img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	flex-shrink: 0;
}

/* No thumbnail → reserve space */
.acf-wes__result:not(:has(img)),
.acf-wes__selected-item:not(:has(img)) {
	padding-left: 40px;
}

/* -------------------------------------------------
 * Text block
 * ------------------------------------------------- */

.acf-wes__result span,
.acf-wes__selected-item span {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

/* -------------------------------------------------
 * Taxonomies
 * ------------------------------------------------- */

.acf-wes__taxonomies {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin-top: 2px;
}

.acf-wes__taxonomy {
	font-size: 11px;
	color: #666;
	white-space: nowrap;
}

/* -------------------------------------------------
 * Checkbox filters
 * ------------------------------------------------- */

.acf-wes__checkboxes {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 12px;
}

.acf-wes__checkbox input {
	margin-right: 4px;
}

/* -------------------------------------------------
 * Empty states
 * ------------------------------------------------- */

.acf-wes__empty {
	color: #777;
	font-size: 12px;
	padding: 6px;
	text-align: center;
}

/* -------------------------------------------------
 * Error state
 * ------------------------------------------------- */

.acf-wes__error {
	color: #c00;
	font-size: 12px;
	padding: 6px;
	text-align: center;
}

/* Loading state */
.acf-wes__results.acf-wes__loading {
	opacity: 0.5;
	pointer-events: none;
}

/* -------------------------------------------------
 * Search row (search + sync button)
 * ------------------------------------------------- */

.acf-wes__search-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
}

.acf-wes__search {
	flex: 1 1 auto;
	max-width: 400px;
}

.acf-wes__sync-btn {
	flex-shrink: 0;
	white-space: nowrap;
}

/* -------------------------------------------------
 * Filter header (label + sort control per taxonomy)
 * ------------------------------------------------- */

.acf-wes__filter-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	margin-bottom: 4px;
}

.acf-wes__filter-label {
	font-weight: 600;
	font-size: 12px;
	text-transform: capitalize;
}

.acf-wes__filter-sort-wrap {
	display: flex;
	align-items: center;
}

.acf-wes__filter-sort {
	font-size: 11px;
	padding: 1px 24px 1px 6px;
	height: auto;
	min-width: 100px;
}

/* "Any" checkbox — slightly muted */
.acf-wes__checkbox--any {
	color: #888;
	font-style: italic;
}

/* -------------------------------------------------
 * List sort control (above results column)
 * ------------------------------------------------- */

.acf-wes__list-sort-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
}

.acf-wes__list-sort-label {
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.acf-wes__list-sort {
	font-size: 12px;
	padding: 2px 24px 2px 6px;
	height: auto;
	min-width: 120px;
}

/* Select All button */
.acf-wes__select-all-btn {
	flex-shrink: 0;
	white-space: nowrap;
}
