/**
 * Stylesheet: A Job Portal (Find A Job - Search & Multi-filter Listing)
 * UX Builder Category: A Elements
 * @package Flatsome Child
 */

:root {
	--a-jp-card-bg: #070a14;
	--a-jp-card-border: rgba(255, 255, 255, 0.08);
	--a-jp-radius: 12px;
	--a-jp-primary: #5073fc;
	--a-jp-primary-hover: #6383fc;
	--a-jp-text-main: #ffffff;
	--a-jp-text-muted: #94a3b8;
	--a-jp-pin-color: #3b82f6;
	--a-jp-salary-color: #38bdf8;
	--a-jp-input-bg: #0c1020;
	--a-jp-input-border: rgba(255, 255, 255, 0.12);
}

/* Master Wrapper */
.a-job-portal {
	position: relative;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: inherit;
}

/* ----------------------------------------------------
   1. FILTER & SEARCH BAR SECTION
   ---------------------------------------------------- */
.a-jp-filter-section {
	margin-bottom: 24px;
	box-sizing: border-box;
}

.a-jp-filter-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	box-sizing: border-box;
}

.a-jp-inputs-row {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
	gap: 12px;
	width: 100%;
	box-sizing: border-box;
}

/* Input / Select Wrap with Icon */
.a-jp-field-wrap {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--a-jp-input-bg, #0c1020);
	border: 1px solid var(--a-jp-input-border, rgba(255, 255, 255, 0.12));
	border-radius: 8px;
	height: 48px;
	box-sizing: border-box;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.a-jp-field-wrap:focus-within {
	border-color: var(--a-jp-primary, #5073fc);
	box-shadow: 0 0 10px rgba(80, 115, 252, 0.25);
}

.a-jp-field-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 100%;
	color: #64748b;
	flex-shrink: 0;
	pointer-events: none;
}

.a-jp-field-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.a-jp-field-wrap input,
.a-jp-field-wrap select {
	width: 100%;
	height: 100%;
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	color: #ffffff !important;
	font-size: 14px;
	font-family: inherit;
	padding: 0 14px 0 0 !important;
	margin: 0 !important;
	box-sizing: border-box;
}

.a-jp-field-wrap {
	position: relative;
	user-select: none;
	cursor: pointer;
}

.a-jp-field-wrap.is-open {
	border-color: var(--a-jp-primary, #5073fc);
	box-shadow: 0 0 12px rgba(80, 115, 252, 0.35);
	z-index: 999999 !important;
}

/* Custom Dropdown Trigger & Label */
.a-jp-field-wrap .a-custom-select-trigger {
	flex: 1;
	min-width: 0;
	height: 100%;
	display: flex;
	align-items: center;
	padding-right: 28px;
	cursor: pointer;
	outline: none;
}

.a-jp-field-wrap .a-custom-select-label {
	display: block;
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	color: #ffffff;
	line-height: normal;
}

.a-jp-field-wrap .a-custom-select-label.is-placeholder {
	color: #64748b;
}

/* Hide native select when custom dropdown is active */
.a-jp-field-wrap 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 */
.a-jp-field-wrap select:not(.a-has-custom-select) {
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	padding-right: 28px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
	background-size: 16px !important;
}

/* Custom Dropdown Floating Menu (Dark Theme) */
.a-jp-field-wrap .a-custom-select-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 100%;
	width: max-content;
	max-width: 320px;
	background: #0b1124;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 12px;
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
	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-jp-field-wrap .a-custom-select-menu.align-right {
	left: auto;
	right: 0;
}

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

.a-jp-field-wrap .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: #cbd5e1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	gap: 12px;
	white-space: nowrap;
	text-align: left;
}

.a-jp-field-wrap .a-custom-select-option:hover {
	background-color: rgba(255, 255, 255, 0.08);
	color: #ffffff;
}

.a-jp-field-wrap .a-custom-select-option.is-selected {
	background-color: rgba(80, 115, 252, 0.2);
	color: #5073fc;
	font-weight: 600;
}

.a-jp-field-wrap .a-custom-select-option .a-cso-check {
	width: 16px;
	height: 16px;
	color: #5073fc;
	display: none;
	flex-shrink: 0;
}

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

.a-jp-field-wrap .a-custom-select-menu::-webkit-scrollbar {
	width: 5px;
}

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

.a-jp-field-wrap .a-custom-select-menu::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 99px;
}

/* Chevron arrow on .a-jp-field-wrap */
.a-jp-field-wrap:has(select)::after,
.a-jp-field-wrap:has(.a-custom-select-trigger)::after {
	content: '';
	position: absolute;
	right: 12px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px;
	pointer-events: none;
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.a-jp-field-wrap.is-open::after {
	transform: rotate(180deg);
}

.a-jp-field-wrap input::placeholder {
	color: #64748b;
}

/* Button Row */
.a-jp-actions-row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.a-jp-btn-search {
	flex: 1;
	height: 48px;
	background: var(--primary-color);
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 14.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.a-jp-btn-reset {
	height: 48px;
	padding: 0 20px;
	background: rgba(255, 255, 255, 0.05);
	color: #94a3b8;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: background-color 0.2s ease, color 0.2s ease;
	margin-right: 0px !important;
}

.a-jp-btn-reset:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
}

/* ----------------------------------------------------
   2. JOB LISTING CONTAINER
   ---------------------------------------------------- */
.a-jp-listing-card {
	position: relative;
	background-color: var(--a-jp-card-bg, #070a14);
	border: 1px solid var(--a-jp-card-border, rgba(255, 255, 255, 0.08));
	border-radius: 5px;
	overflow: hidden;
	box-sizing: border-box;
}

.a-jp-listing-body {
	display: flex;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
}

/* Individual Job Row */
.a-job-row {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	box-sizing: border-box;
	text-decoration: none !important;
	color: inherit;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.a-job-row:last-child {
	border-bottom: none;
}

.a-job-row:hover {
	background-color: rgba(255, 255, 255, 0.025);
}

/* Col 1: Logo */
.a-job-col-logo {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.a-job-logo-circle {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	flex-shrink: 0;
}

.a-job-logo-circle img,
.a-job-logo-circle svg {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Col 2: Job Title & Meta */
.a-job-col-title {
	flex: 1 1 320px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.a-job-title-text {
	font-family: inherit;
	font-size: 15.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--a-jp-text-main, #ffffff);
	margin: 0;
	line-height: 1.35;
	transition: color 0.2s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.a-job-row:hover .a-job-title-text {
	color: #60a5fa;
}

/* Tag Pills */
.a-job-tags {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.a-job-tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
	line-height: 1.4;
}

.a-job-tag.tag-level {
	background: rgba(59, 130, 246, 0.15);
	color: #60a5fa;
	border: 1px solid rgba(59, 130, 246, 0.3);
}

.a-job-tag.tag-type {
	background: rgba(16, 185, 129, 0.15);
	color: #34d399;
	border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Col 3: Location */
.a-job-col-loc {
	flex: 0 0 170px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--a-jp-text-muted, #94a3b8);
}

.a-job-pin-svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: var(--a-jp-pin-color, #3b82f6);
}

/* Col 4: Salary */
.a-job-col-salary {
	flex: 0 0 160px;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--a-jp-salary-color, #38bdf8);
}

.a-job-salary-icon {
	font-size: 15px;
	line-height: 1;
}

/* Col 5: Deadline */
.a-job-col-date {
	flex: 0 0 140px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--a-jp-text-muted, #94a3b8);
	justify-content: flex-end;
}

.a-job-calendar-svg {
	width: 17px;
	height: 17px;
	flex-shrink: 0;
}

/* Col 6: Action Button */
.a-job-col-action {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	padding-left: 8px;
}

.a-job-btn-apply {
	padding: 6px 14px;
	background: rgba(80, 115, 252, 0.15);
	color: #93c5fd;
	border: 1px solid rgba(80, 115, 252, 0.3);
	border-radius: 6px;
	font-size: 12.5px;
	font-weight: 600;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.a-job-row:hover .a-job-btn-apply {
	background: var(--a-jp-primary, #5073fc);
	color: #ffffff;
	border-color: var(--a-jp-primary, #5073fc);
}

/* Empty / No Jobs Found */
.a-job-empty {
	padding: 60px 20px;
	text-align: center;
	color: #94a3b8;
}

.a-job-empty-icon {
	font-size: 40px;
	margin-bottom: 12px;
	display: block;
}

.a-job-empty-title {
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
	margin-bottom: 6px;
}

.a-job-empty-desc {
	font-size: 14px;
	color: #94a3b8;
}

/* ----------------------------------------------------
   2.1 LOAD MORE LISTINGS & PAGINATION
   ---------------------------------------------------- */
.a-jp-loadmore-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	padding-top: 20px;
	width: 100%;
}

.a-jp-btn-loadmore {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 28px;
	background: transparent;
	border: 1.5px solid #2563eb;
	border-radius: 6px;
	color: #3b82f6;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.25s ease;
	user-select: none;
	-webkit-user-select: none;
	outline: none;
	text-transform: none;
}

.a-jp-btn-loadmore:hover {
	background: rgba(37, 99, 235, 0.12);
	border-color: #3b82f6;
	color: #60a5fa;
}

.a-jp-btn-loadmore:active {
	transform: translateY(0);
}

.a-jp-btn-loadmore:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* Loading States & Spinners */
.a-jp-listing-card.is-loading {
	pointer-events: none;
}

.a-jp-listing-card.is-loading .a-jp-listing-body {
	opacity: 0.45;
	transition: opacity 0.2s ease;
}

@keyframes a-jp-spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

.a-jp-spin {
	animation: a-jp-spin 0.8s linear infinite;
	display: inline-block;
}

.a-jp-btn-loadmore-spinner {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.a-jp-btn-search-spinner {
	display: inline-flex;
	align-items: center;
}

/* ----------------------------------------------------
   3. RESPONSIVE
   ---------------------------------------------------- */
@media (max-width: 1024px) {
	.a-jp-inputs-row {
		grid-template-columns: 1fr 1fr;
	}

	.a-jp-field-keyword {
		grid-column: span 2;
	}

	.a-job-col-salary {
		flex: 0 0 130px;
	}

	.a-job-col-loc {
		flex: 0 0 140px;
	}
}

@media (max-width: 768px) {
	.a-jp-inputs-row {
		grid-template-columns: 1fr;
	}

	.a-jp-field-keyword {
		grid-column: span 1;
	}

	.a-job-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding: 16px 18px;
	}

	.a-job-header-mobile {
		display: flex;
		align-items: center;
		gap: 14px;
		width: 100%;
	}

	.a-job-col-title {
		flex: 1;
	}

	.a-job-title-text {
		white-space: normal;
		font-size: 15px;
	}

	.a-job-meta-mobile {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;
		gap: 10px;
		width: 100%;
		padding-top: 8px;
		border-top: 1px dashed rgba(255, 255, 255, 0.08);
	}

	.a-job-col-loc,
	.a-job-col-salary,
	.a-job-col-date {
		flex: 0 0 auto;
		justify-content: flex-start;
	}

	.a-job-col-action {
		width: 100%;
		padding-left: 0;
	}

	.a-job-btn-apply {
		width: 100%;
		text-align: center;
		padding: 8px 0;
	}
}