/**
 * Stylesheet: A Job Search Bar (Thanh Tìm Kiếm Việc Làm)
 * UX Builder Category: A Elements
 * 
 * @package Flatsome Child
 */

.a-job-search-bar-wrap {
	width: 100%;
	box-sizing: border-box;
	margin: 0 auto;
	position: relative;
	z-index: 99;
}

.a-job-search-bar-wrap.has-dropdown-open,
.a-job-search-bar-wrap:has(.is-open) {
	position: relative !important;
	z-index: 999999 !important;
}

.a-job-search-bar-inner {
	display: flex;
	align-items: center;
	justify-content: var(--a-jsb-align, center);
	flex-wrap: wrap;
	gap: 16px;
	padding: 12px 14px;
	background: var(--a-jsb-bar-bg, transparent);
	border: 1px solid var(--a-jsb-bar-border, transparent);
	border-radius: var(--a-jsb-bar-radius, 8px);
	box-sizing: border-box;
	position: relative;
	z-index: 99;
}

.a-job-search-bar-wrap.has-dropdown-open .a-job-search-bar-inner {
	z-index: 999999 !important;
}

/* Parent container boost when dropdown is open */
.a-dropdown-parent-boost {
	z-index: 999999 !important;
	position: relative !important;
	overflow: visible !important;
}

/* Shadow variants */
.a-job-search-bar-wrap.shadow-sm .a-job-search-bar-inner {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.a-job-search-bar-wrap.shadow-md .a-job-search-bar-inner {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.a-job-search-bar-wrap.shadow-lg .a-job-search-bar-inner {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* 1. Left Title: LOOKING FOR A JOB ? */
.a-jsb-left-title {
	font-weight: var(--a-jsb-title-weight, 700);
	font-size: var(--a-jsb-title-size, 15px);
	color: var(--a-jsb-title-color, #0f172a);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	white-space: nowrap;
	margin-right: 4px;
	line-height: 1.2;
}

/* 2. Main Search Form Container */
.a-jsb-form {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Common Field Box (Job title & Location) */
.a-jsb-field {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--a-jsb-input-bg, #ffffff);
	border: 1px solid var(--a-jsb-input-border, #e2e8f0);
	border-radius: var(--a-jsb-input-radius, 6px);
	height: var(--a-jsb-input-height, 46px);
	min-height: var(--a-jsb-input-height, 46px);
	padding: 0 14px 0 12px;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.a-jsb-field:focus-within,
.a-jsb-field:hover {
	border-color: var(--a-jsb-focus-border, #4361ee);
}

.a-jsb-field:focus-within {
	box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

/* Field Icons (Magnifier & Pin) */
.a-jsb-field-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--a-jsb-icon-color, #4361ee);
	width: 20px;
	height: 20px;
	margin-right: 10px;
	flex-shrink: 0;
}

.a-jsb-field-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Keyword Input */
.a-jsb-field-keyword {
	width: 190px;
}

.a-jsb-input-keyword {
	border: none !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	height: 100% !important;
	color: var(--a-jsb-input-color, #1e293b) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	width: 100%;
	line-height: normal !important;
}

.a-jsb-input-keyword::placeholder {
	color: var(--a-jsb-placeholder-color, #94a3b8);
	font-weight: 400;
	opacity: 1;
}

/* Select Fields (Location, Industry, Job Level) */
.a-jsb-field-location,
.a-jsb-field-industry,
.a-jsb-field-level {
	min-width: 155px;
	padding-right: 34px;
	cursor: pointer;
	user-select: none;
}

/* Custom Dropdown Trigger & Label */
.a-custom-select-trigger {
	flex: 1;
	min-width: 0;
	height: 100%;
	display: flex;
	align-items: center;
	outline: none;
}

.a-custom-select-label {
	display: block;
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 500;
	color: var(--a-jsb-input-color, #1e293b);
	line-height: normal;
}

.a-custom-select-label.is-placeholder {
	color: var(--a-jsb-placeholder-color, #94a3b8);
	font-weight: 400;
}

/* Visually hide native select while keeping it active for forms and scripts */
.a-jsb-field select.a-has-custom-select {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	clip: rect(0, 0, 0, 0) !important;
	margin: -1px !important;
	overflow: hidden !important;
	z-index: -1 !important;
}

/* Fallback for native select if JS is disabled */
.a-jsb-select-location:not(.a-has-custom-select),
.a-jsb-select-industry:not(.a-has-custom-select),
.a-jsb-select-level:not(.a-has-custom-select) {
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	height: 100% !important;
	color: var(--a-jsb-input-color, #1e293b) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	width: 100%;
	cursor: pointer;
	line-height: normal !important;
}

/* Custom Dropdown Floating Menu */
.a-custom-select-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 100%;
	width: max-content;
	max-width: 320px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
	padding: 6px;
	margin: 0;
	list-style: none;
	z-index: 9999999 !important;
	max-height: 260px;
	overflow-y: auto;
	overscroll-behavior: contain;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px) scale(0.98);
	transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
		visibility 0.2s;
	pointer-events: none;
	box-sizing: border-box;
}

.a-custom-select-menu.align-right {
	left: auto;
	right: 0;
}

/* Field Open State */
.a-jsb-field.is-open {
	border-color: var(--a-jsb-focus-border, #4361ee);
	box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.14);
	z-index: 999999 !important;
}

.a-jsb-field.is-open .a-custom-select-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Option Items inside Menu */
.a-custom-select-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #334155;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	gap: 12px;
	white-space: nowrap;
	text-align: left;
}

.a-custom-select-option:hover {
	background-color: #f1f5f9;
	color: #4361ee;
}

.a-custom-select-option.is-selected {
	background-color: #eef2ff;
	color: #4361ee;
	font-weight: 600;
}

.a-custom-select-option .a-cso-check {
	width: 16px;
	height: 16px;
	color: #4361ee;
	display: none;
	flex-shrink: 0;
}

.a-custom-select-option.is-selected .a-cso-check {
	display: block;
}

/* Custom Slim Scrollbar */
.a-custom-select-menu::-webkit-scrollbar {
	width: 5px;
}

.a-custom-select-menu::-webkit-scrollbar-track {
	background: transparent;
}

.a-custom-select-menu::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 99px;
}

.a-custom-select-menu::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Dropdown Chevron Icon on Right */
.a-jsb-chevron-icon {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--a-jsb-icon-color, #4361ee);
	width: 16px;
	height: 16px;
}

.a-jsb-chevron-icon svg {
	width: 100%;
	height: 100%;
	display: block;
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.a-jsb-field.is-open .a-jsb-chevron-icon svg {
	transform: rotate(180deg);
}

/* 3. Search Action Button */
.a-jsb-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--a-jsb-input-height, 46px);
	min-height: var(--a-jsb-input-height, 46px);
	padding: 0 var(--a-jsb-btn-pad, 26px);
	background: var(--a-jsb-btn-bg, #4361ee);
	color: var(--a-jsb-btn-color, #ffffff) !important;
	border: none !important;
	border-radius: var(--a-jsb-input-radius, 6px);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: 0 2px 6px rgba(67, 97, 238, 0.28);
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	margin: 0;
}

.a-jsb-submit-btn:hover {
	background: var(--a-jsb-btn-hover-bg, #3451db);
	box-shadow: 0 4px 14px rgba(67, 97, 238, 0.38);
	transform: translateY(-1px);
}

.a-jsb-submit-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 4px rgba(67, 97, 238, 0.2);
}

/* 4. Vertical Divider Line */
.a-jsb-divider {
	width: 1px;
	height: 28px;
	background: var(--a-jsb-divider-color, #d1d5db);
	margin: 0 8px;
	flex-shrink: 0;
}

/* 5. Right Link: LOOKING TO HIRE */
.a-jsb-hire-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	text-decoration: none !important;
	color: var(--a-jsb-hire-color, #0f172a) !important;
	font-weight: 700;
	font-size: var(--a-jsb-hire-size, 14px);
	letter-spacing: 0.6px;
	text-transform: uppercase;
	white-space: nowrap;
	padding: 6px 0;
	line-height: 1.2;
	transition: color 0.2s ease;
}

.a-jsb-hire-link:hover {
	color: var(--a-jsb-focus-border, #4361ee) !important;
}

/* Underline accent on LOOKING TO HIRE */
.a-jsb-hire-link.has-underline::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 2px;
	background: var(--a-jsb-hire-underline, #22c55e);
	border-radius: 2px;
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
	transform-origin: left;
}

.a-jsb-hire-link.has-underline:hover::after {
	transform: scaleX(1.06);
	background: var(--a-jsb-focus-border, #4361ee);
}

/* Responsive Media Queries */
@media (max-width: 991px) {
	.a-job-search-bar-inner {
		justify-content: center;
		gap: 12px;
	}

	.a-jsb-left-title {
		width: 100%;
		text-align: center;
		margin-bottom: 4px;
	}
}

@media (max-width: 767px) {
	.a-job-search-bar-inner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
	}

	.a-jsb-left-title {
		text-align: center;
		margin-bottom: 8px;
		font-size: 15px;
	}

	.a-jsb-form {
		display: flex;
		flex-direction: column;
		width: 100%;
		gap: 10px;
	}

	.a-jsb-field {
		width: 100%;
	}

	.a-jsb-field-keyword,
	.a-jsb-field-location,
	.a-jsb-field-industry,
	.a-jsb-field-level {
		min-width: 100%;
	}

	.a-jsb-submit-btn {
		width: 100%;
	}

	.a-jsb-divider {
		display: none;
	}

	.a-jsb-hire-link {
		justify-content: center;
		text-align: center;
		margin-top: 6px;
	}
}