/**
 * YFJ employer search — form, preview, candidate cards, student notifications.
 */

/* ── Search form ────────────────────────────────────────────────────────── */

.yfj-search {
	max-width: 980px;
	margin: 0 auto;
}

.yfj-search-form {
	background: #fff;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 14px;
	padding: 28px;
}

.yfj-search-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 22px;
}

.yfj-search-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.yfj-search-field select,
.yfj-search-field input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}

.yfj-search-field select[multiple] {
	padding: 6px;
	min-height: 110px;
}

.yfj-hint {
	display: block;
	font-size: 12px;
	color: var(--yfj-muted, #64748B);
	margin-top: 5px;
	line-height: 1.4;
}

/* ── Killarney block ────────────────────────────────────────────────────── */

.yfj-killarney-block {
	background: #F8FAFC;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 12px;
	padding: 22px;
	margin: 0;
}

.yfj-killarney-block h4 {
	font-size: 15px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin: 0 0 4px;
}

.yfj-killarney-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
	margin: 16px 0;
}

.yfj-killarney-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--yfj-navy, #1B2E5E);
	margin-bottom: 5px;
}

.yfj-killarney-field select {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 7px;
	font-size: 13px;
	background: #fff;
}

.yfj-tolerance {
	padding-top: 16px;
	border-top: 1px solid #E2E8F0;
}

.yfj-tolerance label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.yfj-tolerance select {
	padding: 9px 12px;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 7px;
	font-size: 14px;
	min-width: 280px;
}

.yfj-search-actions {
	padding-top: 8px;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

/* Preserve the original stacked layout for the out-of-searches warning text —
 * it was a block-level <p> that naturally fell to its own line before this
 * container became a flex row; flex-basis: 100% keeps that same behavior. */
.yfj-search-actions .yfj-hint {
	flex-basis: 100%;
	text-align: right;
}

/* ── Preview ────────────────────────────────────────────────────────────── */

.yfj-search-preview {
	margin-top: 28px;
	background: #fff;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 14px;
	padding: 28px;
}

.yfj-preview-header h3 {
	font-size: 22px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin: 0 0 6px;
}

.yfj-preview-table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
	font-size: 14px;
}

.yfj-preview-table th {
	text-align: left;
	padding: 10px 12px;
	background: var(--yfj-navy, #1B2E5E);
	color: #fff;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 700;
}

.yfj-preview-table th:first-child { border-radius: 8px 0 0 0; }
.yfj-preview-table th:last-child  { border-radius: 0 8px 0 0; }

.yfj-preview-table td {
	padding: 11px 12px;
	border-bottom: 1px solid #EDF1F7;
}

.yfj-preview-table tbody tr:nth-child(even) {
	background: #F8FAFC;
}

.yfj-mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 1px;
	font-weight: 600;
}

.yfj-match-pill {
	display: inline-block;
	padding: 3px 10px;
	background: #E1F5EE;
	color: #0F6E56;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
}

.yfj-preview-confirm {
	margin-top: 24px;
	padding-top: 22px;
	border-top: 1px solid #E2E8F0;
}

.yfj-confirm-notice {
	background: #FFF7ED;
	border-left: 4px solid var(--yfj-orange, #E8521A);
	border-radius: 0 8px 8px 0;
	padding: 16px 20px;
	font-size: 14px;
	line-height: 1.6;
	color: #7C2D12;
	margin-bottom: 18px;
}

/* ── Search list ────────────────────────────────────────────────────────── */

.yfj-search-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.yfj-search-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 20px 24px;
	background: #fff;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-left-width: 4px;
	border-radius: 10px;
}

.yfj-search-item.yfj-status-amber { border-left-color: #D97706; }
.yfj-search-item.yfj-status-green { border-left-color: #1A7A3C; }
.yfj-search-item.yfj-status-grey  { border-left-color: #94A3B8; }

.yfj-search-item h4 {
	font-size: 16px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin: 0 0 4px;
}

.yfj-search-item-meta {
	font-size: 13px;
	color: var(--yfj-muted, #64748B);
	margin: 0;
}

.yfj-countdown {
	font-size: 13px;
	color: #D97706;
	font-weight: 600;
	margin: 6px 0 0;
}

.yfj-search-item-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */

.yfj-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.yfj-badge-amber { background: #FEF3C7; color: #92400E; }
.yfj-badge-green { background: #D1FAE5; color: #065F46; }
.yfj-badge-grey  { background: #F1F5F9; color: #475569; }

/* ── Candidate cards ────────────────────────────────────────────────────── */

.yfj-candidates-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-bottom: 20px;
	margin-bottom: 24px;
	border-bottom: 2px solid var(--yfj-border, #E2E8F0);
}

.yfj-candidates-header h3 {
	font-size: 22px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin: 0 0 2px;
}

.yfj-candidate {
	background: #fff;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 16px;
}

.yfj-candidate-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.yfj-candidate-head h4 {
	font-size: 19px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin: 0 0 3px;
}

.yfj-candidate-sub {
	font-size: 14px;
	color: var(--yfj-muted, #64748B);
	margin: 0;
}

.yfj-match-badge {
	background: #E1F5EE;
	color: #0F6E56;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	flex-shrink: 0;
}

.yfj-candidate-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px 24px;
	padding: 18px 0;
	border-top: 1px solid #EDF1F7;
	border-bottom: 1px solid #EDF1F7;
	margin-bottom: 18px;
}

.yfj-candidate-grid > div {
	font-size: 14px;
	color: #334155;
}

.yfj-candidate-grid span {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: var(--yfj-muted, #64748B);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 3px;
}

.yfj-candidate-killarney {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.yfj-killarney-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--yfj-muted, #64748B);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-right: 4px;
}

.yfj-band-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	color: #fff;
	font-weight: 800;
	font-size: 14px;
	cursor: help;
}

.yfj-candidate-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.yfj-btn-sm {
	padding: 9px 18px;
	font-size: 14px;
}

.yfj-btn-ghost {
	background: transparent;
	color: var(--yfj-orange, #E8521A) !important;
	border: 1px solid var(--yfj-orange, #E8521A);
}

.yfj-btn-ghost:hover {
	background: #FFF7F4;
}

/* ── Student notifications ──────────────────────────────────────────────── */

.yfj-notifications-title {
	font-size: 12px;
	font-weight: 700;
	color: var(--yfj-muted, #64748B);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0 0 14px;
}

.yfj-notification {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-left-width: 4px;
	border-radius: 10px;
	margin-bottom: 10px;
}

.yfj-notification.yfj-status-amber { border-left-color: #D97706; background: #FFFBEB; }
.yfj-notification.yfj-status-green { border-left-color: #1A7A3C; }
.yfj-notification.yfj-status-grey  { border-left-color: #94A3B8; }

/* Highlighted when linked to via #yfj-request-<id> from the email CTA — a
 * pure browser-side scroll target, never sent to the server, so there is
 * nothing here that needs server-side validation. */
.yfj-notification:target {
	outline: 2px solid var(--yfj-filter-accent, #ed4b28);
	outline-offset: 2px;
}

.yfj-notification-company {
	font-size: 16px;
	font-weight: 700;
	color: var(--yfj-navy, #1B2E5E);
	margin: 0 0 4px;
}

.yfj-notification-desc {
	font-size: 13.5px;
	color: #475569;
	margin: 0;
	line-height: 1.5;
}

.yfj-notification-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

/* ── Notice variants ────────────────────────────────────────────────────── */

.yfj-notice-success {
	background: #F0FFF4;
	border-left-color: #1A7A3C;
	color: #0A3D1F;
}

.yfj-notice-warn {
	background: #FFFBEB;
	border-left-color: #D97706;
	color: #78350F;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 782px) {
	.yfj-search-row {
		grid-template-columns: 1fr;
	}

	.yfj-search-form,
	.yfj-search-preview {
		padding: 20px;
	}

	.yfj-search-item,
	.yfj-notification,
	.yfj-candidates-header,
	.yfj-candidate-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.yfj-search-item-actions,
	.yfj-notification-actions {
		width: 100%;
		justify-content: space-between;
	}

	.yfj-preview-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.yfj-tolerance select {
		min-width: 100%;
	}
}

/* ── Killarney checkbox grid (replaces the select + tolerance UI) ─────── */
.yfj-killarney-grid-cb {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px; margin-top: 14px;
}
.yfj-killarney-dim {
	background: #fff; border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 10px; padding: 12px 14px;
}
.yfj-killarney-dim h5 {
	font-size: 12px; font-weight: 700; color: var(--yfj-navy, #1B2E5E);
	margin: 0 0 10px; text-transform: uppercase; letter-spacing: .4px;
}
.yfj-kcb {
	display: flex; align-items: center; gap: 7px;
	padding: 6px 0; font-size: 13px; color: #334155; cursor: pointer;
}
.yfj-kcb input { flex-shrink: 0; }
.yfj-kcb-text { flex: 1; }

.yfj-kcb-tip {
	position: relative; display: inline-flex; color: #94A3B8; cursor: help; flex-shrink: 0;
}
.yfj-kcb-tip:hover .yfj-kcb-tip-bubble,
.yfj-kcb-tip:focus .yfj-kcb-tip-bubble { display: block; }
.yfj-kcb-tip-bubble {
	display: none; position: absolute; bottom: calc(100% + 8px); right: -8px;
	width: 220px; background: var(--yfj-navy, #1B2E5E); color: #fff;
	font-size: 12px; line-height: 1.5; padding: 10px 12px; border-radius: 8px;
	box-shadow: 0 6px 18px rgba(15,23,42,.2); z-index: 20;
}

@media (max-width: 640px) {
	.yfj-killarney-grid-cb { grid-template-columns: 1fr; }
}

/* ── Search allowance badge ─────────────────────────────────────────── */
.yfj-search-allowance {
	display: inline-flex; align-items: baseline; gap: 8px;
	background: #F0FFF4; border: 1px solid #BBF7D0; border-radius: 10px;
	padding: 10px 16px; margin-bottom: 16px; font-size: 13px;
}
.yfj-search-allowance-count { font-size: 20px; font-weight: 800; color: #1A7A3C; }
.yfj-search-allowance-label { color: #166534; }
.yfj-search-allowance.is-empty { background: #FFF7ED; border-color: #FED7AA; }
.yfj-search-allowance.is-empty .yfj-search-allowance-count { color: #B45309; }
.yfj-search-allowance.is-empty .yfj-search-allowance-label { color: #92400E; }
.yfj-notice-warn { background: #FFFBEB; border-left: 4px solid #D97706; color: #78350F; padding: 12px 16px; border-radius: 0 8px 8px 0; margin-bottom: 16px; }

/* ── Dismissible notice — duplicated here (not imported from employer.css)
 * because this stylesheet loads on the Employer Search page independently
 * of the 'search' bundle employer.css belongs to. Keep both copies in sync
 * if the dismiss-button style ever changes. ── */
.yfj-dismissible-notice { position: relative; padding-right: 40px !important; }
.yfj-notice-dismiss {
	position: absolute; top: 8px; right: 8px;
	width: 26px; height: 26px; border: none; background: transparent;
	font-size: 20px; line-height: 1; color: #94A3B8; cursor: pointer;
	border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.yfj-notice-dismiss:hover { background: rgba(0,0,0,.06); color: #475569; }

/* ═══════════════════════════════════════════════════════════════════════
 * SIDEBAR LAYOUT
 * ═══════════════════════════════════════════════════════════════════════ */

.yfj-search-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 28px;
	align-items: start;
}

.yfj-search-sidebar {
	display: flex;
	flex-direction: column;
	gap: 18px;
	background: #F8FAFC;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 12px;
	padding: 20px;
}

.yfj-search-sidebar .yfj-search-field { margin: 0; }

/*
 * Filter accent color: #ed4b28, per exact brand spec — kept as its own
 * token (distinct from --yfj-orange, #E8521A) rather than reusing the
 * general button-hover orange, since this value was given specifically for
 * filter interaction states. Change it in exactly one place if it ever needs
 * to update again.
 *
 * accent-color (below) covers checkboxes/radios but CANNOT reach the native
 * option-highlight color inside a plain <select> dropdown's open list — that
 * internal rendering is OS/browser UI, outside any CSS's reach. GPA min/max
 * remain plain native selects, so their open-dropdown option list may still
 * show a system highlight color on some OS/browser combinations; the field
 * itself (border, focus ring) is fully covered below regardless.
 */
:root { --yfj-filter-accent: #ed4b28; }

.yfj-search-sidebar select,
.yfj-search-sidebar input[type="text"],
.yfj-ms-search,
.yfj-ms-opt input,
.yfj-kcb input {
	accent-color: var(--yfj-filter-accent);
}

.yfj-search-sidebar select:hover,
.yfj-search-sidebar select:focus,
.yfj-search-sidebar input[type="text"]:hover,
.yfj-search-sidebar input[type="text"]:focus,
.yfj-search-sidebar select:focus-visible,
.yfj-search-sidebar input[type="text"]:focus-visible,
.yfj-ms-trigger:hover,
.yfj-ms-trigger:focus,
.yfj-ms-trigger:focus-visible,
.yfj-ms-search:hover,
.yfj-ms-search:focus,
.yfj-ms-search:focus-visible {
	border-color: var(--yfj-filter-accent);
	outline: 2px solid var(--yfj-filter-accent);
	outline-offset: 1px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* :active — the moment of clicking/tapping, distinct from hover/focus */
.yfj-ms-trigger:active,
.yfj-search-sidebar select:active {
	border-color: var(--yfj-filter-accent);
	background: #FFF4EE;
}

.yfj-ms-opt:hover,
.yfj-kcb:hover {
	background: #FFF4EE;
}

/* Selected/checked state — modern browsers (:has support is broad as of
 * 2024+ across Chrome, Edge, Safari; on older browsers this simply has no
 * visual effect and the row falls back to its unchecked appearance, which
 * is a safe, non-breaking degradation). */
.yfj-ms-opt:has(input:checked),
.yfj-kcb:has(input:checked) {
	background: #FFF4EE;
	color: var(--yfj-filter-accent);
}

.yfj-search-row-tight {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.yfj-search-main {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
 * MULTI-SELECT — chips + searchable checklist, replaces native <select multiple>
 * ═══════════════════════════════════════════════════════════════════════ */

select.yfj-ms-source {
	/* Kept in the DOM as the real form data source — never removed, only
	 * visually hidden. Screen readers and keyboard-only form submission
	 * still see valid <option> data via this element. */
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.yfj-ms { position: relative; }

.yfj-ms-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 6px;
}

.yfj-ms-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #EEF2FF;
	color: var(--yfj-navy, #1B2E5E);
	font-size: 12.5px;
	font-weight: 600;
	padding: 4px 6px 4px 10px;
	border-radius: 20px;
	max-width: 100%;
}

.yfj-ms-chip-x {
	border: 0; background: rgba(27,46,94,.12); color: var(--yfj-navy, #1B2E5E);
	width: 18px; height: 18px; border-radius: 50%; font-size: 13px; line-height: 1;
	cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.yfj-ms-chip-x:hover { background: rgba(27,46,94,.22); }

.yfj-ms-trigger {
	width: 100%;
	text-align: left;
	padding: 10px 12px;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 13.5px;
	color: var(--yfj-muted, #64748B);
	cursor: pointer;
}
.yfj-ms-trigger:hover { border-color: #C7D2E8; }

.yfj-ms-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 30;
	background: #fff;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 10px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
	padding: 10px;
}

.yfj-ms-search {
	width: 100%;
	padding: 8px 10px;
	margin-bottom: 8px;
	border: 1px solid var(--yfj-border, #E2E8F0);
	border-radius: 7px;
	font-size: 13px;
	font-family: inherit;
}

.yfj-ms-options {
	max-height: 220px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.yfj-ms-opt {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 8px;
	border-radius: 6px;
	font-size: 13px;
	color: #334155;
	cursor: pointer;
}
.yfj-ms-opt.is-disabled { color: #CBD5E1; cursor: not-allowed; }
.yfj-ms-opt.is-disabled:hover { background: transparent; }
.yfj-ms-opt input { flex-shrink: 0; }

.yfj-ms-max-note {
	font-size: 11.5px;
	color: #B45309;
	background: #FFFBEB;
	padding: 6px 8px;
	border-radius: 6px;
	margin: 0 0 6px;
}

.yfj-ms-empty {
	font-size: 13px;
	color: #94A3B8;
	padding: 10px 8px;
	margin: 0;
	text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
 * RESPONSIVE — sidebar collapses above the main filters on small screens
 * ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
	.yfj-search-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
	.yfj-search-row-tight { grid-template-columns: 1fr; }
}

/* Back to Dashboard — positioning only; .yfj-btn/.yfj-btn-quiet/.yfj-btn-sm
 * are the existing global button styles, reused as-is with no new button
 * CSS. This just gives it breathing room above the rest of the page. */
.yfj-search-back {
	display: inline-flex;
	margin-bottom: 18px;
}

/* ── Keyword match-mode radios ─────────────────────────────────────── */
.yfj-kw-mode {
	display: flex;
	gap: 16px;
	margin: 8px 0 6px;
}
.yfj-kw-radio {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #334155;
	cursor: pointer;
}
.yfj-kw-radio input {
	accent-color: var(--yfj-filter-accent, #ed4b28);
}
