/**
 * Aramjoo Career Portal - Frontend Stylesheet
 * Pixel-perfect implementation based on mockups
 */

/* ==========================================================================
   CSS Variables & Resets
   ========================================================================== */
:root {
	--alf-primary: #2563eb;
	--alf-primary-dark: #1d4ed8;
	--alf-primary-light: #3b82f6;
	--alf-navy: #1e40af;
	--alf-text-dark: #111827;
	--alf-text-body: #374151;
	--alf-text-muted: #4b5563;
	--alf-border: #d1d5db;
	--alf-border-light: #e5e7eb;
	--alf-bg-highlight: #eff6ff;
	--alf-radius: 6px;
	--alf-radius-pill: 9999px;
	--alf-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

/* Hide theme's default post title if theme renders it outside our filtered content */
body.single-career_job .wp-block-post-title,
body.alf-single-job .wp-block-post-title,
body.single-career_job .entry-header,
body.single-career_job .entry-header .entry-title,
body.single-career_job h1.entry-title,
body.alf-single-job h1.entry-title {
	display: none !important;
}

/* ==========================================================================
   Main Career Portal Container (Listing Page)
   ========================================================================== */
.alf-career-portal-container {
	font-family: var(--alf-font);
	color: var(--alf-text-body);
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 20px 0;
	box-sizing: border-box;
}

.alf-career-portal-container *,
.alf-career-portal-container *::before,
.alf-career-portal-container *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   Filter Bar (Search, Department, Office)
   ========================================================================== */
.alf-filters-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	align-items: flex-start;
	margin-bottom: 24px;
}

@media (max-width: 768px) {
	.alf-filters-row {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

.alf-filter-col {
	display: flex;
	flex-direction: column;
	position: relative;
}

.alf-filter-label {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--alf-text-dark);
	margin-bottom: 6px;
}

/* Search input */
.alf-input-wrap {
	position: relative;
	width: 100%;
}

.alf-search-input {
	width: 100%;
	height: 44px;
	padding: 8px 36px 8px 14px;
	font-family: inherit;
	font-size: 14.5px;
	color: var(--alf-text-dark);
	background-color: #ffffff;
	border: 1px solid var(--alf-border);
	border-radius: var(--alf-radius);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.alf-search-input:focus {
	outline: none;
	border-color: var(--alf-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.alf-search-input::placeholder {
	color: #9ca3af;
}

.alf-search-clear {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: #9ca3af;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
	padding: 4px;
}

.alf-search-clear:hover {
	color: var(--alf-text-dark);
}

/* ==========================================================================
   Custom Dropdowns (Department & Office)
   ========================================================================== */
.alf-dropdown {
	position: relative;
	width: 100%;
}

.alf-dropdown-trigger {
	width: 100%;
	height: 44px;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 14.5px;
	color: var(--alf-text-dark);
	background-color: #ffffff;
	border: 1px solid var(--alf-border);
	border-radius: var(--alf-radius);
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.alf-dropdown-trigger:focus,
.alf-dropdown.is-open .alf-dropdown-trigger {
	outline: none;
	border-color: var(--alf-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.alf-dropdown-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding-right: 8px;
}

.alf-chevron {
	color: #1f2937;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.alf-dropdown.is-open .alf-chevron {
	transform: rotate(180deg);
}

/* Dropdown Menu Popup */
.alf-dropdown-menu {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 1000;
	background: #ffffff;
	border: 1px solid var(--alf-border);
	border-radius: var(--alf-radius);
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
	max-height: 280px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 #f8fafc;
}

.alf-dropdown.is-open .alf-dropdown-menu {
	display: block;
}

.alf-dropdown-menu::-webkit-scrollbar {
	width: 8px;
}

.alf-dropdown-menu::-webkit-scrollbar-track {
	background: #f8fafc;
}

.alf-dropdown-menu::-webkit-scrollbar-thumb {
	background-color: #cbd5e1;
	border-radius: 4px;
}

.alf-dropdown-item {
	padding: 10px 16px;
	font-size: 14px;
	color: var(--alf-text-dark);
	cursor: pointer;
	transition: background-color 0.12s ease;
}

.alf-dropdown-item:hover {
	background-color: #f3f4f6;
}

.alf-dropdown-item.is-selected {
	background-color: var(--alf-bg-highlight);
	color: var(--alf-primary-dark);
	font-weight: 500;
}

/* ==========================================================================
   Job Counter
   ========================================================================== */
.alf-counter-row {
	margin: 36px 0 20px 0;
}

.alf-counter-text {
	font-size: 32px;
	font-weight: 600;
	color: var(--alf-navy);
	letter-spacing: -0.02em;
	line-height: 1.2;
}

/* ==========================================================================
   Listings Container & Department Groups
   ========================================================================== */
.alf-listings-wrapper {
	position: relative;
	min-height: 200px;
}

.alf-loading-overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(2px);
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 60px;
	z-index: 50;
}

.alf-listings-wrapper.is-loading .alf-loading-overlay {
	display: flex;
}

.alf-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid #e2e8f0;
	border-top-color: var(--alf-primary);
	border-radius: 50%;
	animation: alfSpin 0.7s linear infinite;
}

@keyframes alfSpin {
	to { transform: rotate(360deg); }
}

.alf-department-group {
	margin-top: 42px;
}

.alf-department-group:first-child {
	margin-top: 10px;
}

.alf-department-title {
	font-size: 24px;
	font-weight: 600;
	color: var(--alf-primary);
	margin: 0 0 10px 0;
	letter-spacing: -0.01em;
}

.alf-jobs-list {
	display: flex;
	flex-direction: column;
}

/* Single Job Row */
.alf-job-item {
	padding: 16px 0;
	border-bottom: 1px solid var(--alf-border-light);
	transition: background-color 0.15s ease;
}

.alf-job-title-row {
	display: flex;
	align-items: center;
}

.alf-job-title-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: inherit;
	transition: color 0.15s ease;
}

.alf-job-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--alf-text-dark);
	line-height: 1.35;
	transition: color 0.15s ease;
}

.alf-job-title-link:hover .alf-job-title {
	color: var(--alf-primary);
}

.alf-badge-new {
	display: inline-block;
	background-color: var(--alf-primary-light);
	color: #ffffff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 4px;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: 0;
}

.alf-job-location {
	font-size: 14px;
	color: var(--alf-text-muted);
	margin-top: 4px;
	line-height: 1.4;
}

/* ==========================================================================
   Empty / No Results State
   ========================================================================== */
.alf-no-results {
	text-align: center;
	padding: 60px 20px;
}

.alf-no-results-icon {
	margin-bottom: 16px;
}

.alf-no-results-title {
	font-size: 20px;
	font-weight: 600;
	color: var(--alf-text-dark);
	margin: 0 0 8px 0;
}

.alf-no-results-desc {
	font-size: 14.5px;
	color: var(--alf-text-muted);
	margin: 0 0 20px 0;
}

.alf-reset-btn {
	display: inline-block;
	background-color: var(--alf-primary);
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 20px;
	border: none;
	border-radius: var(--alf-radius);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.alf-reset-btn:hover {
	background-color: var(--alf-primary-dark);
}

/* ==========================================================================
   Detail Page (Single Job View - Screenshot 2)
   ========================================================================== */
.alf-detail-wrapper {
	font-family: var(--alf-font);
	color: var(--alf-text-body);
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	padding: 24px 0 60px 0;
	box-sizing: border-box;
}

.alf-detail-wrapper *,
.alf-detail-wrapper *::before,
.alf-detail-wrapper *::after {
	box-sizing: border-box;
}

/* Back navigation */
.alf-detail-nav {
	margin-bottom: 24px;
}

.alf-back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--alf-primary);
	font-size: 14.5px;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.15s ease;
}

.alf-back-link:hover {
	color: var(--alf-primary-dark);
	text-decoration: underline;
}

.alf-back-link svg {
	flex-shrink: 0;
}

/* Header with Title, Location, and Apply Button */
.alf-detail-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 24px;
	margin-bottom: 32px;
}

@media (max-width: 640px) {
	.alf-detail-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

.alf-detail-title-col {
	flex: 1;
}

.alf-detail-title {
	font-size: 34px;
	font-weight: 700;
	color: var(--alf-primary);
	line-height: 1.25;
	margin: 0 0 8px 0;
	letter-spacing: -0.02em;
}

@media (max-width: 640px) {
	.alf-detail-title {
		font-size: 28px;
	}
}

.alf-detail-location {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	color: var(--alf-text-body);
	margin-top: 6px;
}

.alf-pin-icon {
	color: var(--alf-text-muted);
	flex-shrink: 0;
}

/* Apply Pill Button */
.alf-apply-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--alf-primary-light);
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 600;
	padding: 10px 28px;
	border-radius: var(--alf-radius-pill);
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.alf-apply-btn:hover {
	background-color: var(--alf-primary);
	color: #ffffff !important;
}

.alf-apply-btn:active {
	transform: scale(0.98);
}

/* Content Body */
.alf-detail-content {
	font-size: 15.5px;
	line-height: 1.7;
	color: var(--alf-text-body);
	margin-bottom: 40px;
}

.alf-detail-content p {
	margin-bottom: 20px;
}

/* Subheadings matching screenshot (underlined bold) */
.alf-detail-content h2,
.alf-detail-content h3,
.alf-detail-content h4,
.alf-detail-subheading {
	font-size: 17px;
	font-weight: 700;
	color: var(--alf-text-dark);
	text-decoration: underline;
	text-underline-offset: 3px;
	margin-top: 28px;
	margin-bottom: 12px;
	line-height: 1.4;
}

.alf-detail-content ul,
.alf-detail-content ol {
	margin: 12px 0 24px 24px;
	padding-left: 0;
}

.alf-detail-content ul {
	list-style-type: disc;
}

.alf-detail-content li {
	margin-bottom: 8px;
	line-height: 1.6;
}

/* Gravity Forms Application Section */
.alf-detail-apply-section {
	margin-top: 48px;
	padding-top: 36px;
	border-top: 1px solid var(--alf-border-light);
}

.alf-apply-box {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 32px;
}

.alf-apply-box-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--alf-text-dark);
	margin-top: 0;
	margin-bottom: 16px;
}

.alf-apply-placeholder {
	color: var(--alf-text-muted);
	font-size: 14.5px;
	line-height: 1.6;
}

.alf-apply-placeholder p {
	margin: 0 0 12px 0;
}
