/**
 * JG DataTables Options - Filter Bar Styles
 * Mobile-friendly responsive styles for filter UI
 */

/* Filter bar container */
.jgdo_filterbar {
	padding: 0 0.75em;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
}

/* Collapsible header - whole bar is clickable to expand/collapse */
.jgdo_filterbar_header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
}

.jgdo_filterbar_title {
	font-weight: 600;
	font-size: 0.95em;
	color: #23282d;
}

.jgdo_filterbar_toggle {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #555;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.jgdo_filterbar_toggle:hover {
	color: #2271b1;
}

.jgdo_filterbar_toggle:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.jgdo_filterbar_toggle .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Collapsible content wrapper */
.jgdo_filterbar_content {
	/* For slideToggle animation */
}

/* Chips container for active filters */
.jgdo_filterbar_chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-bottom: 0.75em;
	padding-bottom: 0.75em;
	border-bottom: 1px solid #ddd;
}

.jgdo_filterbar_chips:empty {
	display: none;
}

/* Filter chip */
.jgdo_filterbar_chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.3em 0.6em;
	background: #2271b1;
	color: #fff;
	border-radius: 3px;
	font-size: 0.85em;
	line-height: 1.4;
}

.jgdo_filterbar_chip_clear_all {
	cursor: pointer;
	border: none;
}

.jgdo_filterbar_chip_clear_all:hover {
	background: #135e96;
}

/* Chip remove button */
.jgdo_filterbar_chip_remove {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 1.1em;
	line-height: 1;
	padding: 0;
	margin-left: 0.25em;
	width: 1.1em;
	height: 1.1em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background-color 0.2s;
}

.jgdo_filterbar_chip_remove:hover {
	background: rgba( 255, 255, 255, 0.2 );
}

.jgdo_filterbar_chip_remove:focus {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Filters container - horizontal by default on desktop */
.jgdo_filterbar_filters {
	display: flex;
	flex-wrap: nowrap;
	gap: 1em;
	overflow-x: auto;
	padding-bottom: 0.25em; /* Space for scrollbar */
}

/* Individual filter */
.jgdo_filterbar_filter {
	flex: 0 0 auto;
	min-width: 150px;
	max-width: 220px;
}

/* Filter label */
.jgdo_filterbar_label {
	display: block;
	margin-bottom: 0.4em;
	font-weight: 600;
	font-size: 0.9em;
	color: #23282d;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Facet filter - checkboxes container */
.jgdo_filterbar_checkboxes {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	max-height: 150px;
	overflow-y: auto;
	padding: 0.4em;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 3px;
}

/* Checkbox wrapper */
.jgdo_filterbar_checkbox_wrapper {
	display: flex;
	align-items: center;
	gap: 0.4em;
}

/* Checkbox input */
.jgdo_filterbar_checkbox {
	margin: 0;
	flex-shrink: 0;
}

/* Checkbox label */
.jgdo_filterbar_checkbox_label {
	margin: 0;
	font-weight: normal;
	font-size: 0.9em;
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Range filter inputs container */
.jgdo_filterbar_range_inputs {
	display: flex;
	gap: 0.5em;
	align-items: flex-end;
}

/* Range input wrapper */
.jgdo_filterbar_range_input_wrapper {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	flex: 1 1 auto;
}

.jgdo_filterbar_range_input_wrapper label {
	font-size: 0.8em;
	font-weight: 500;
	color: #555;
}

/* Range input */
.jgdo_filterbar_range_input {
	width: 100%;
	padding: 0.4em;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	font-size: 0.9em;
}

.jgdo_filterbar_range_input:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 1px #2271b1;
}

/* Range suffix */
.jgdo_filterbar_range_suffix {
	margin-left: 0.25em;
	font-size: 0.85em;
	color: #555;
}

/* Mobile responsive styles */
@media screen and ( max-width: 782px ) {
	.jgdo_filterbar {
		padding: 0.6em;
	}

	.jgdo_filterbar_filters {
		flex-direction: column;
		flex-wrap: wrap;
		gap: 0.75em;
		overflow-x: visible;
	}

	.jgdo_filterbar_filter {
		min-width: 100%;
		max-width: 100%;
		width: 100%;
	}

	/* Single column layout for checkboxes on mobile */
	.jgdo_filterbar_checkboxes {
		max-height: 120px;
	}

	.jgdo_filterbar_range_inputs {
		flex-direction: row;
		gap: 0.5em;
	}

	.jgdo_filterbar_range_input_wrapper {
		width: auto;
	}
}

/* Accessibility improvements */
.jgdo_filterbar_checkbox:focus,
.jgdo_filterbar_range_input:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Print styles */
@media print {
	.jgdo_filterbar {
		display: none;
	}
}
