/* ==========================================================================
   HFJ Filter Panel
   Shared filter UI for /latest-jobs and /search-resumes.
   Scoped to .hfj-filters so it never leaks into other Select2 instances.
   Loaded after frontend.css (via @push('styles')) so it wins on equal
   specificity; the .frontend-wrapper prefix matches the existing overrides.
   ========================================================================== */

.hfj-filters {
    --hfj-brand: #6152aa;
    --hfj-brand-dark: #4c4088;
    --hfj-brand-soft: rgba(97, 82, 170, 0.10);
    --hfj-brand-softer: rgba(97, 82, 170, 0.06);
    --hfj-border: #e4e7ec;
    --hfj-text: #1f2937;
    --hfj-muted: #6b7280;

    /* The value a single-select is currently carrying. Its own purple, a shade
       lighter than the brand so a filled field reads as filled without
       competing with the search button. */
    --hfj-value: #7466bd;
    --hfj-value-border: rgba(116, 102, 189, 0.55);
    --hfj-value-wash: linear-gradient(180deg, #f8f7fd 0%, #f2f0fb 100%);

    /* Applied-filter accent. The tint is light enough that chip text has to be
       the deep end of the same hue to stay readable on it. */
    --hfj-accent: #7cdbe3;
    --hfj-accent-deep: #3fb9c4;
    --hfj-accent-ink: #0d5b63;
    --hfj-accent-soft: rgba(124, 219, 227, 0.28);

    /* One light source, top-left, for every raised surface in the panel: a
       bright inset edge along the top and a stacked drop shadow below. */
    --hfj-lift: 0 1px 1px rgba(16, 24, 40, 0.04), 0 4px 10px rgba(16, 24, 40, 0.05);
    --hfj-lift-hover: 0 2px 4px rgba(16, 24, 40, 0.05), 0 10px 22px rgba(97, 82, 170, 0.14);

    position: relative;
    background: linear-gradient(180deg, #fff 0%, #fcfcfe 100%);
    border: 1px solid var(--hfj-border);
    border-radius: 20px;
    box-shadow:
        inset 0 1px 0 #fff,
        0 1px 2px rgba(16, 24, 40, 0.04),
        0 12px 28px rgba(16, 24, 40, 0.08),
        0 28px 56px rgba(16, 24, 40, 0.06);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* The whole card lifts when the pointer is anywhere inside it — the shadow
   deepens and picks up the brand tint, so the panel reads as the active
   surface while you work through it. Held through :focus-within so it does
   not drop while a field is being typed in or tabbed to.

   Deliberately shadow-only, no transform: Select2 appends its dropdowns to
   <body> and positions them from the control's measured box, so moving the
   card even a pixel would leave an open dropdown misaligned the moment the
   pointer crossed onto it (the dropdown sits outside .hfj-filters, so
   reaching for it counts as leaving the panel). */
.hfj-filters:hover,
.hfj-filters:focus-within {
    border-color: rgba(97, 82, 170, 0.28);
    box-shadow:
        inset 0 1px 0 #fff,
        0 2px 4px rgba(16, 24, 40, 0.05),
        0 20px 44px rgba(97, 82, 170, 0.18),
        0 44px 84px rgba(16, 24, 40, 0.10);
}

/* Brand rail across the top edge — reads as the lit face of the card. */
.hfj-filters::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--hfj-brand) 0%, #8b7ad0 45%, var(--hfj-accent) 100%);
    transition: box-shadow 0.3s ease;
    z-index: 1;
}

/* The rail glows with the card, so the lift starts at the top edge. */
.hfj-filters:hover::before,
.hfj-filters:focus-within::before {
    box-shadow: 0 2px 14px rgba(97, 82, 170, 0.55);
}

/* --------------------------------------------------------------- header -- */

.hfj-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(180deg, var(--hfj-brand-softer) 0%, rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid var(--hfj-border);
    box-shadow: 0 1px 0 #fff;
}

/* .hfj-filters prefix so the theme's h2 sizing doesn't win */
.hfj-filters .hfj-filters__title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.0625rem !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    letter-spacing: 0;
    text-transform: none;
    color: var(--hfj-text) !important;
    margin: 0 !important;
}

.hfj-filters__title .fea,
.hfj-filters__title svg {
    width: 18px;
    height: 18px;
    color: var(--hfj-brand);
}

.hfj-filters__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: linear-gradient(180deg, #7466bd 0%, var(--hfj-brand) 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 2px 5px rgba(97, 82, 170, 0.35);
}

.hfj-filters__head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* "Clear all" is a raised pill rather than a bare link: it sits next to the
   collapse toggle, so it needs the same physical weight to read as a control.
   The ⟲ is drawn in CSS so the button stays markup-compatible with the two
   pages that already ship it. */
/* Solid accent pill with white text — the same badge treatment as the skill
   tags on the candidate cards and the homepage tiles. */
.hfj-filters__reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 0;
    border-radius: 20px;
    background: var(--hfj-accent);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 2px 6px rgba(13, 91, 99, 0.18);
    transition: color 0.2s ease, background 0.2s ease,
                box-shadow 0.2s ease, transform 0.15s ease;
}

.hfj-filters__reset::before {
    content: '\21BA';
    font-size: 0.9375rem;
    line-height: 1;
    transition: transform 0.35s ease;
}

.hfj-filters__reset:hover {
    color: #fff;
    background: var(--hfj-accent-deep);
    box-shadow: 0 8px 18px rgba(13, 91, 99, 0.28);
    transform: translateY(-1px);
}

.hfj-filters__reset:hover::before {
    transform: rotate(-180deg);
}

/* Pressed: drops back onto the card and the shadow collapses inward. */
.hfj-filters__reset:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(16, 24, 40, 0.10);
}

.hfj-filters__toggle {
    display: none;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--hfj-border);
    background: linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hfj-text);
    box-shadow:
        inset 0 1px 0 #fff,
        var(--hfj-lift);
}

.hfj-filters__toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

.hfj-filters.is-collapsed .hfj-filters__toggle svg {
    transform: rotate(-180deg);
}

.hfj-filters__body {
    padding: 20px;
}

/* --------------------------------------------------------------- fields -- */

.hfj-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Raised above its neighbours so the zoomed control overlaps them rather
       than being clipped by the next field in the grid. */
    position: relative;
    z-index: 0;
    transition: z-index 0s;
}

.hfj-field:hover,
.hfj-field:focus-within {
    z-index: 3;
}

.hfj-field__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #475467;
    text-transform: none;
}

.hfj-field__count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #8477c6 0%, var(--hfj-value) 100%);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 1px 2px rgba(76, 64, 136, 0.25);
}

.hfj-field__count.is-visible {
    display: inline-flex;
}

/* The whole field reacts as one on hover — label included — so it is obvious
   which one the pointer is on when six of them sit in a grid. The control
   scales up off its own centre, which reads as the field coming forward. */
.hfj-field:hover .hfj-field__label {
    color: var(--hfj-brand-dark);
}

/* Kept small on purpose: the grid gutter is 16px, so 3% on a ~340px field
   overhangs ~5px a side and never collides with its neighbour. */
.hfj-filters .hfj-field {
    --hfj-zoom: scale(1.03);
}

/* Keyword / plain text inputs inside the panel */
.hfj-filters .hfj-field .form-control:not(.select2-hidden-accessible) {
    height: 48px !important;
    min-height: 48px !important;
    border: 1.5px solid var(--hfj-border) !important;
    border-radius: 12px !important;
    padding: 0 14px !important;
    font-size: 0.9375rem !important;
    color: var(--hfj-text);
    background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%) !important;
    box-shadow: var(--hfj-lift) !important;
    transform-origin: center;
    transition: border-color 0.22s ease, background 0.22s ease,
                box-shadow 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.hfj-filters .hfj-field:hover .form-control:not(.select2-hidden-accessible):not(:focus) {
    border-color: var(--hfj-brand) !important;
    background: linear-gradient(180deg, #fff 0%, #faf9fe 100%) !important;
    box-shadow: 0 0 0 4px var(--hfj-brand-soft), var(--hfj-lift-hover) !important;
    transform: var(--hfj-zoom);
}

/* Focus keeps the zoom, so tabbing through reads the same as hovering. */
.hfj-filters .hfj-field .form-control:not(.select2-hidden-accessible):focus {
    border-color: var(--hfj-brand) !important;
    box-shadow: 0 0 0 4px var(--hfj-brand-soft), var(--hfj-lift-hover) !important;
    transform: var(--hfj-zoom);
}

/* ------------------------------------------------------- select2: shared -- */
/* frontend.css and the theme's style.min.css style Select2 with !important in
   several places, so the panel has to answer in kind. Everything here is
   scoped to .hfj-filters / .hfj-dropdown, so nothing else is affected. */

.frontend-wrapper .hfj-filters .select2-container {
    width: 100% !important;
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--single,
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple {
    border: 1.5px solid var(--hfj-border) !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%) !important;
    box-shadow: var(--hfj-lift) !important;
    backdrop-filter: none !important;
    transform: none !important;
    transform-origin: center;
    transition: border-color 0.22s ease, background 0.22s ease,
                box-shadow 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1) !important;
}

/* Hover is driven from .hfj-field, not the selection itself, so the label and
   the box light up together and the multi-selects react even when the pointer
   is over the gap beside their chips.
   The open state is excluded on purpose: Select2 measures the control to place
   its dropdown, and a scaled box would leave the panel hanging off-edge. */
.frontend-wrapper .hfj-filters .hfj-field:hover .select2-container--default:not(.select2-container--open) .select2-selection--single,
.frontend-wrapper .hfj-filters .hfj-field:hover .select2-container--default:not(.select2-container--open) .select2-selection--multiple {
    border-color: var(--hfj-brand) !important;
    background: linear-gradient(180deg, #fff 0%, #faf9fe 100%) !important;
    box-shadow: 0 0 0 4px var(--hfj-brand-soft), var(--hfj-lift-hover) !important;
    transform: var(--hfj-zoom) !important;
}

/* Kills the theme's glassmorphism overlay, which sat on top of the chips. */
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--single::before,
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple::before {
    display: none !important;
}

.frontend-wrapper .hfj-filters .select2-container--default.select2-container--focus .select2-selection--single,
.frontend-wrapper .hfj-filters .select2-container--default.select2-container--focus .select2-selection--multiple,
.frontend-wrapper .hfj-filters .select2-container--default.select2-container--open .select2-selection--single,
.frontend-wrapper .hfj-filters .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--hfj-brand) !important;
    box-shadow: 0 0 0 4px var(--hfj-brand-soft), var(--hfj-lift-hover) !important;
}

/* Keyboard focus zooms like hover does; opening the list drops back to the
   measured size so the dropdown lines up with the control. */
.frontend-wrapper .hfj-filters .select2-container--default.select2-container--focus:not(.select2-container--open) .select2-selection--single,
.frontend-wrapper .hfj-filters .select2-container--default.select2-container--focus:not(.select2-container--open) .select2-selection--multiple {
    transform: var(--hfj-zoom) !important;
}

.frontend-wrapper .hfj-filters .select2-container--default.select2-container--open .select2-selection--single,
.frontend-wrapper .hfj-filters .select2-container--default.select2-container--open .select2-selection--multiple {
    transform: none !important;
}

/* ------------------------------------------------------- select2: single -- */

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--single {
    height: 48px !important;
    min-height: 48px !important;
    display: flex;
    align-items: center;
    padding: 0 38px 0 14px !important;
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: 1.3;
    font-size: 0.9375rem !important;
    font-weight: 500;
    color: var(--hfj-text);
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--single .select2-selection__placeholder {
    font-size: 0.9375rem !important;
    font-weight: 400 !important;
    color: #9ca3af !important;
}

/* Arrow. frontend.css:638 pins this box to `height: 4rem !important` and
   `right: 1.75rem !important` — 64px tall on a 48px control — so the theme's
   triangle, which centres itself inside that box, ended up sitting ~6px below
   the control's middle with its hit area hanging out the bottom. Re-anchor the
   box to the control's own height (top/bottom 0 + auto height beats a fixed
   one) and centre the mark with flex rather than a 50% + margin guess.
   The !important is answering theirs, not raising the stakes. */
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 0 !important;
    bottom: 0 !important;
    right: 13px !important;
    height: auto !important;
    width: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Clicks fall through to the selection, which is what opens the list. */
    pointer-events: none;
}

/* A two-sided chevron instead of the solid triangle: lighter, and it can
   rotate between states instead of being redrawn with a different border box. */
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--single .select2-selection__arrow b {
    position: static !important;
    width: 9px !important;
    height: 9px !important;
    /* The ink sits on the lower-right corner, so once rotated its centroid
       lands ~2.5px below the box centre. A negative margin in a centring flex
       parent moves the box by half its value, hence -5px to cancel ~2.5px. */
    margin: -5px 0 0 0 !important;
    border: 0 !important;
    border-right: 2px solid var(--hfj-brand) !important;
    border-bottom: 2px solid var(--hfj-brand) !important;
    border-radius: 0 0 2px 0;
    transform: rotate(45deg);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

/* Open: the chevron flips up rather than swapping border boxes. */
.frontend-wrapper .hfj-filters .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-width: 0 2px 2px 0 !important;
    border-right-color: var(--hfj-brand-dark) !important;
    border-bottom-color: var(--hfj-brand-dark) !important;
    /* Flipped, so the centroid is now above the box centre — mirror the nudge. */
    margin-top: 5px !important;
    transform: rotate(-135deg);
}

/* A filter that is actually filtering gets the value-purple chevron, matching
   the text beside it. */
.frontend-wrapper .hfj-filters .select2-container.hfj-has-value .select2-selection--single .select2-selection__arrow b {
    border-right-color: var(--hfj-value) !important;
    border-bottom-color: var(--hfj-value) !important;
}

/* A chosen value looks chosen in every filter, not just in the multi-selects:
   the "All Countries" style catch-all option is a real <option> here, so the
   value can't be told apart from the empty state in CSS alone — filter-panel.js
   flags the containers that are actually filtering with .hfj-has-value.

   The whole control carries the state — tinted border, soft purple wash, value
   in #7466bd across the field's full width — rather than a shrink-wrapped pill
   inside it. A pill sized to its text left a ragged edge that moved with every
   country name and collided with the chevron on the long ones; a filled field
   keeps all three selects the same shape whatever is picked, and gives a long
   name the whole width before it has to truncate. */
.frontend-wrapper .hfj-filters .select2-container.hfj-has-value .select2-selection--single {
    border-color: var(--hfj-value-border) !important;
    background: var(--hfj-value-wash) !important;
}

.frontend-wrapper .hfj-filters .select2-container.hfj-has-value .select2-selection--single .select2-selection__rendered {
    /* flex child, so `width: 100%` would measure against the padding box and
       overhang the arrow — grow into the space that is left instead. */
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    color: var(--hfj-value) !important;
    font-size: 0.9375rem !important;
    font-weight: 700;
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover and focus already recolour the border to brand purple; the wash stays,
   so the field never flashes back to looking empty while it is being used. */
.frontend-wrapper .hfj-filters .hfj-field:hover .select2-container.hfj-has-value:not(.select2-container--open) .select2-selection--single,
.frontend-wrapper .hfj-filters .select2-container.hfj-has-value.select2-container--focus .select2-selection--single,
.frontend-wrapper .hfj-filters .select2-container.hfj-has-value.select2-container--open .select2-selection--single {
    background: var(--hfj-value-wash) !important;
}

/* Same cue for a typed keyword, which has no dropdown to mark. */
.hfj-filters .hfj-field .form-control.hfj-has-value:not(.select2-hidden-accessible) {
    color: var(--hfj-value);
    font-weight: 600;
}

/* …but the focus ring stays in charge while the box is being typed in. */
.hfj-filters .hfj-field .form-control.hfj-has-value:not(.select2-hidden-accessible):not(:focus) {
    border-color: var(--hfj-value-border) !important;
    background: var(--hfj-value-wash) !important;
}

/* ----------------------------------------------------- select2: multiple -- */

/* Grows with the chips, then scrolls — so picking eight skills never pushes
   the rest of the form around. */
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple {
    min-height: 48px !important;
    height: auto !important;
    max-height: 122px;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 7px 10px !important;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 6px;
    cursor: text;
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple::-webkit-scrollbar {
    width: 6px;
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 999px;
}

/* Filled Industries/Skills read the same as a filled single select: tinted
   border and the purple wash behind the chips. */
.frontend-wrapper .hfj-filters .select2-container.hfj-has-value .select2-selection--multiple {
    border-color: var(--hfj-value-border) !important;
    background: var(--hfj-value-wash) !important;
}

.frontend-wrapper .hfj-filters .hfj-field:hover .select2-container.hfj-has-value:not(.select2-container--open) .select2-selection--multiple,
.frontend-wrapper .hfj-filters .select2-container.hfj-has-value.select2-container--focus .select2-selection--multiple,
.frontend-wrapper .hfj-filters .select2-container.hfj-has-value.select2-container--open .select2-selection--multiple {
    background: var(--hfj-value-wash) !important;
}

/* Chips: soft pills instead of heavy solid blocks — a dozen of them still
   reads as one field rather than a wall of purple. Same #7466bd as the value
   on a single select, but filled a shade deeper than the field's wash so a
   chip still reads as an object sitting on the field. */
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin: 0 !important;
    padding: 4px 10px !important;
    border: 1px solid var(--hfj-value-border) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #efecfa 0%, #e3ddf6 100%) !important;
    color: var(--hfj-value) !important;
    font-size: 0.8125rem !important;
    font-weight: 700;
    line-height: 1.4;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 2px rgba(76, 64, 136, 0.15) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple .select2-selection__choice:hover {
    background: linear-gradient(180deg, #e5e0f7 0%, #d5cdf0 100%) !important;
    border-color: rgba(116, 102, 189, 0.85) !important;
    transform: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 3px 8px rgba(76, 64, 136, 0.22) !important;
}

/* Push the remove control after the label (Select2 renders it first). */
.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8) !important;
    color: var(--hfj-value) !important;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: var(--hfj-value) !important;
    color: #fff !important;
    transform: none;
}

.frontend-wrapper .hfj-filters .select2-container--default .select2-search--inline .select2-search__field {
    height: 26px !important;
    line-height: 26px !important;
    margin: 0 !important;
    padding: 0 2px !important;
    font-size: 0.9375rem !important;
    font-weight: 400;
}

/* --------------------------------------------------- select2: dropdowns -- */
/* Select2 appends dropdowns to <body>, outside .hfj-filters, so filter-panel.js
   tags them with .hfj-dropdown (+ .hfj-dropdown--multi) on select2:open. */

.select2-dropdown.hfj-dropdown {
    border: 1px solid var(--hfj-border, #e4e7ec) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14) !important;
    overflow: hidden;
    backdrop-filter: none !important;
}

.select2-container--default .hfj-dropdown .select2-search--dropdown {
    padding: 10px !important;
    border-bottom: 1px solid #f2f4f7;
}

.select2-container--default .hfj-dropdown .select2-search--dropdown .select2-search__field {
    height: 40px !important;
    border: 1.5px solid #e4e7ec !important;
    border-radius: 10px !important;
    padding: 0 12px !important;
    font-size: 0.9rem !important;
    outline: none;
}

.select2-container--default .hfj-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: #6152aa !important;
    box-shadow: 0 0 0 3px rgba(97, 82, 170, 0.12) !important;
}

/* A locked dropdown holds a single "pick X first" row (HFJFilters.lock), so
   there is nothing to search through — drop the search box and let the menu be
   just the message, the way the multi-selects already read. */
.select2-container--default .hfj-dropdown--locked .select2-search--dropdown {
    display: none !important;
}

/* frontend.css gives .select2-results its own max-height/overflow, which nests
   a second scrollbar inside the list and keeps the "load more" row out of
   view. Only the option list should scroll. */
.select2-container--default .hfj-dropdown .select2-results {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
}

/* ~4 rows tall, with the next one cut off at the fold: that half-row is the
   cue that the list scrolls, and scrolling is what pulls the next page in
   (HFJFilters.paginate). A taller box would fit a whole page of options and
   the "load more" row would never come into view on its own. */
.select2-container--default .hfj-dropdown .select2-results > .select2-results__options {
    max-height: 190px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 6px;
}

.select2-container--default .hfj-dropdown .select2-results__option {
    padding: 9px 12px !important;
    border-radius: 9px !important;
    font-size: 0.9rem !important;
    color: #344054;
    background: transparent;
}

.select2-container--default .hfj-dropdown .select2-results__option--highlighted,
.select2-container--default .hfj-dropdown .select2-results__option--highlighted[aria-selected],
.select2-container--default .hfj-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(97, 82, 170, 0.10) !important;
    color: #4c4088 !important;
}

/* A picked option is filled in every filter. frontend.css already painted
   picked rows through its [aria-selected=true] rule, but only where its own
   selector won: the moment a picked row was also the highlighted one it washed
   back out to the soft hover tint, and the single selects — which Select2 opens
   with their current value highlighted — never showed it at all.
   The [aria-selected] on the second selector is there for weight only (every
   option carries the attribute); the state itself is read from --selected,
   since this build puts aria-selected on the highlighted row too.
   A picked row is #7466bd, the same colour the value takes on the closed
   control. The dropdown is appended to <body>, outside .hfj-filters, so the
   panel's custom properties are out of reach here — hence the literal. */
.select2-container--default .select2-dropdown.hfj-dropdown .select2-results__option--selected,
.select2-container--default .select2-dropdown.hfj-dropdown .select2-results__option--selected[aria-selected] {
    background: #7466bd !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Hovering or arrowing onto a picked row deepens it instead of washing it out. */
.select2-container--default .select2-dropdown.hfj-dropdown .select2-results__option--selected.select2-results__option--highlighted,
.select2-container--default .select2-dropdown.hfj-dropdown .select2-results__option--selected.select2-results__option--highlighted[aria-selected] {
    background: #6152aa !important;
    color: #fff !important;
}

/* The multi lists carry the state on their leading-edge checkbox; the single
   ones get a check at the trailing edge instead. */
.select2-container--default .hfj-dropdown:not(.hfj-dropdown--multi) .select2-results__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* White, because the row it sits on is filled #7466bd. */
.select2-container--default .hfj-dropdown:not(.hfj-dropdown--multi) .select2-results__option--selected::after {
    content: '\2713';
    flex: 0 0 auto;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

/* The "Loading more results…" row Select2 appends while paging. It doubles as
   the "there is more below" affordance, so make it read like a hint rather
   than a selectable option. */
.select2-container--default .hfj-dropdown .select2-results__option--load-more,
.select2-container--default .hfj-dropdown .select2-results__option.loading-results {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
    padding: 10px 12px !important;
    border-top: 1px dashed #e4e7ec;
    border-radius: 0 !important;
    background: transparent !important;
    color: #98a2b3 !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    cursor: default;
}

.select2-container--default .hfj-dropdown .select2-results__option--load-more::after,
.select2-container--default .hfj-dropdown .select2-results__option.loading-results::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(97, 82, 170, 0.25);
    border-top-color: #6152aa;
    border-radius: 50%;
    animation: hfj-spin 0.7s linear infinite;
}

@keyframes hfj-spin {
    to { transform: rotate(360deg); }
}

/* The "Please select the industry first" / "…the country first" row a
   dependent dropdown holds while its parent is unset (HFJFilters.lock). It is
   a disabled <option>, so give it the same hint treatment as the loading row:
   muted, centred, and clearly not a choice. */
.select2-container--default .hfj-dropdown .select2-results__option--disabled,
.select2-container--default .hfj-dropdown .select2-results__option[aria-disabled="true"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px !important;
    background: transparent !important;
    color: #98a2b3 !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    text-align: center;
    cursor: default;
}

/* …and no checkbox in front of it: there is nothing to tick. */
.select2-container--default .hfj-dropdown--multi .select2-results__option--disabled::before,
.select2-container--default .hfj-dropdown--multi .select2-results__option[aria-disabled="true"]::before {
    content: none !important;
}

/* Multi dropdowns get real checkboxes so the list reads as "pick several"
   and stays open while you do it (closeOnSelect: false). */
.select2-container--default .hfj-dropdown--multi .select2-results__option {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* …but the loading row is not a choice, so it gets no checkbox. */
.select2-container--default .hfj-dropdown--multi .select2-results__option--load-more::before,
.select2-container--default .hfj-dropdown--multi .select2-results__option.loading-results::before {
    content: none !important;
}

.select2-container--default .hfj-dropdown--multi .select2-results__option::before {
    content: '';
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 1.5px solid #cfd4dc;
    border-radius: 5px;
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

/* NB: this build uses aria-selected for the *highlighted* row (activedescendant),
   so the checked state keys off --selected only. */
.select2-container--default .hfj-dropdown--multi .select2-results__option--selected::before {
    content: '\2713';
    display: flex;
    align-items: center;
    justify-content: center;
    /* White box, purple tick — the row underneath it is filled #7466bd. */
    border-color: #fff;
    background: #fff;
    color: #7466bd;
    font-size: 12px;
    font-weight: 700;
}

.select2-container--default .hfj-dropdown .select2-results__message {
    color: #98a2b3;
    font-size: 0.875rem;
}

/* ----------------------------------------------------- active chips bar -- */

/* A recessed tray: the bar is pressed *into* the card (inset shadow, tinted
   floor) so the chips sitting on it — which are raised — read as objects laid
   in a slot rather than more flat text at the bottom of the form.
   The floor is neutral grey, not teal: the chips themselves are solid teal
   (same pill as .badge.skill-tag on the result cards), and a teal-on-teal tray
   flattened them back into the background. */
.hfj-active {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid #e7ecf2;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7f9fc 0%, #fdfefe 100%);
    box-shadow:
        inset 0 2px 4px rgba(16, 24, 40, 0.04),
        inset 0 -1px 0 #fff;
}

.hfj-active[hidden] {
    display: none;
}

.hfj-active__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #667085;
    margin-right: 2px;
}

/* Small filled dot, so the label anchors the row without needing an icon in
   the markup (both pages ship the same bare <span>). */
.hfj-active__label::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hfj-accent-deep);
    box-shadow: 0 0 0 3px rgba(124, 219, 227, 0.35);
}

.hfj-active__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

/* Each applied filter is the same pill the result cards use for skills
   (.badge.rounded-pill.skill-tag in frontend.css): flat teal, white bold text,
   11.5px, soft teal shadow, and a 2px lift on hover. Keeping the two identical
   means a "Skills: Admin Manager" chip here and the "Admin Manager" badge on a
   card below read as the same object. */
.hfj-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 0.42rem 0.5rem 0.42rem 0.9rem;
    border: 1px solid #7cdbe3;
    border-radius: 999px;
    background: #7cdbe3;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.35;
    color: #fff;
    box-shadow: 0 3px 10px rgba(78, 199, 212, 0.22);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hfj-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(78, 199, 212, 0.34);
}

.hfj-chip:focus-visible {
    outline: 2px solid var(--hfj-accent-ink);
    outline-offset: 2px;
}

.hfj-chip:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(78, 199, 212, 0.28);
}

/* The group name is context, not the value — it stays legible but recedes
   behind the value it qualifies. */
.hfj-chip__group {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    white-space: nowrap;
}

.hfj-chip__group::after {
    content: ':';
}

.hfj-chip__value {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hfj-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.hfj-chip:hover .hfj-chip__remove,
.hfj-chip:focus-visible .hfj-chip__remove {
    background: #fff;
    color: var(--hfj-accent-ink);
}

/* "Clear all" rendered as a chip (the mirror bar on the no-results card): the
   odd one out in the row, so its dashed outline keeps it apart from the solid
   value chips while it carries the same accent. */
.hfj-chip--clear,
.hfj-empty__chips .hfj-chip--clear {
    padding: 0.42rem 0.9rem;
    border: 1px dashed rgba(63, 185, 196, 0.7);
    background: #fff;
    color: var(--hfj-accent-ink);
    font-weight: 700;
    box-shadow: none;
}

.hfj-chip--clear:hover,
.hfj-empty__chips .hfj-chip--clear:hover {
    border-style: solid;
    border-color: #7cdbe3;
    background: #7cdbe3;
    color: #fff;
    box-shadow: 0 7px 18px rgba(78, 199, 212, 0.34);
}

/* -------------------------------------------------------------- actions -- */

.hfj-filters__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hfj-filters__actions .btn {
    height: 48px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
                box-shadow 0.2s ease, transform 0.15s ease;
}

.frontend-wrapper .hfj-filters__actions .hfj-btn-search {
    flex: 1 1 auto;
    min-width: 150px;
    border: 0;
    background: linear-gradient(180deg, #7466bd 0%, var(--hfj-brand) 55%, #55499a 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 2px 4px rgba(76, 64, 136, 0.22),
        0 10px 22px rgba(97, 82, 170, 0.32);
}

.frontend-wrapper .hfj-filters__actions .hfj-btn-search:hover {
    background: linear-gradient(180deg, #6a5cb4 0%, #55499a 55%, #453b80 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 4px 8px rgba(76, 64, 136, 0.24),
        0 16px 30px rgba(97, 82, 170, 0.40);
    transform: translateY(-2px);
}

.frontend-wrapper .hfj-filters__actions .hfj-btn-search:active {
    transform: translateY(0);
    box-shadow: inset 0 3px 7px rgba(38, 31, 74, 0.40);
}

/* The secondary "Clear" carries the same solid-accent badge treatment as
   "Clear all" and the skill tags; Search keeps the purple, so the two still
   read in the right order. */
.frontend-wrapper .hfj-filters__actions .hfj-btn-clear {
    flex: 0 0 auto;
    background: var(--hfj-accent);
    border: 0;
    border-radius: 20px;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(13, 91, 99, 0.18);
}

.frontend-wrapper .hfj-filters__actions .hfj-btn-clear:hover {
    color: #fff !important;
    background: var(--hfj-accent-deep);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(13, 91, 99, 0.30);
}

.frontend-wrapper .hfj-filters__actions .hfj-btn-clear:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 5px rgba(13, 91, 99, 0.28);
}

/* ---------------------------------------------------------- empty state -- */
/* The card itself is the site's shared .empty-state.glass-card (see the
   homepage's "Employees Hungry For Jobs" section) — only the extras below are
   ours: the removable filter chips, which are the same ones as the panel's
   (rendered by HFJFilters' `mirror` option) so the fix for "no results" is one
   click away from the message that reports it, plus the search tips. */

.hfj-empty {
    --hfj-brand: #6152aa;
    --hfj-brand-dark: #4c4088;
    --hfj-brand-soft: rgba(97, 82, 170, 0.10);
    --hfj-border: #e4e7ec;
    --hfj-muted: #6b7280;

    /* The mirrored chips live out here, outside .hfj-filters, so they need
       their own copy of the accent + lift tokens. */
    --hfj-accent: #7cdbe3;
    --hfj-accent-deep: #3fb9c4;
    --hfj-accent-ink: #0d5b63;
    --hfj-lift: 0 1px 1px rgba(16, 24, 40, 0.04), 0 4px 10px rgba(16, 24, 40, 0.05);
    --hfj-lift-hover: 0 2px 4px rgba(16, 24, 40, 0.05), 0 10px 22px rgba(97, 82, 170, 0.14);

    /* The footer's curved top rides up over the end of the page, so the card
       needs clearance of its own — the section's mb-5 isn't enough. */
    margin-bottom: 80px;
}

/* .empty-state centres with flex, so children stretch to full width unless
   they say otherwise. */
.hfj-empty > * {
    width: 100%;
}

.hfj-empty .empty-icon {
    line-height: 1;
}

/* ----- applied filters, repeated here so they can be dropped from here ---- */

.hfj-empty__filters {
    padding: 18px;
    margin-bottom: 28px;
    background: linear-gradient(180deg, rgba(124, 219, 227, 0.13) 0%, rgba(124, 219, 227, 0.05) 100%);
    border: 1px solid rgba(124, 219, 227, 0.45);
    border-radius: 14px;
    box-shadow:
        inset 0 2px 5px rgba(13, 91, 99, 0.07),
        inset 0 -1px 0 #fff;
}

.hfj-empty__filters[hidden] {
    display: none;
}

.hfj-empty__filters-label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hfj-accent-ink);
}

.hfj-empty__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* -------------------------------------------------------------- actions -- */

.hfj-empty__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.frontend-wrapper .hfj-empty__actions .hfj-btn-ghost {
    background: linear-gradient(180deg, #fff 0%, #f4f5f7 100%);
    border: 1.5px solid var(--hfj-border);
    color: #475467 !important;
    box-shadow:
        inset 0 1px 0 #fff,
        var(--hfj-lift);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
                box-shadow 0.2s ease, transform 0.15s ease;
}

.frontend-wrapper .hfj-empty__actions .hfj-btn-ghost:hover {
    border-color: rgba(97, 82, 170, 0.45);
    color: var(--hfj-brand) !important;
    background: linear-gradient(180deg, #fff 0%, #f6f5fc 100%);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 #fff,
        var(--hfj-lift-hover);
}

.frontend-wrapper .hfj-empty__actions .hfj-btn-ghost:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 5px rgba(16, 24, 40, 0.12);
}

/* ----------------------------------------------------------------- tips -- */
/* Three tiles rather than a row of loose sentences: each one leads with what
   to change, so they can be skimmed instead of read. */

.hfj-empty__tips {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px dashed var(--hfj-border);
}

.hfj-empty__tips-label {
    display: block;
    margin-bottom: 16px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #98a2b3;
}

.hfj-empty__tips-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hfj-tip {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--hfj-border);
    border-radius: 14px;
    text-align: start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hfj-tip:hover {
    border-color: rgba(97, 82, 170, 0.45);
    box-shadow: 0 8px 20px rgba(97, 82, 170, 0.10);
    transform: translateY(-2px);
}

.hfj-tip__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--hfj-brand-soft);
    color: var(--hfj-brand);
}

.hfj-tip__icon .mdi {
    font-size: 1.125rem;
    line-height: 1;
}

.hfj-tip__body {
    min-width: 0;
}

.hfj-tip__title {
    display: block;
    margin-bottom: 3px;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.35;
    color: #344054;
}

.hfj-tip__text {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--hfj-muted);
}

/* ------------------------------------------------------------------ rtl -- */

.rtl .hfj-chip__group::after {
    content: ':';
}

/* The × sits on the trailing edge, so the tight side of the pill flips. */
.rtl .hfj-chip {
    padding: 0.42rem 0.9rem 0.42rem 0.5rem;
}

.rtl .hfj-chip--clear {
    padding: 0.42rem 0.9rem;
}

.rtl .hfj-filters .select2-container--default .select2-selection--single {
    padding: 0 14px 0 38px;
}

/* !important for the same reason as the LTR rule — frontend.css:638 sets
   `right` with one, and leaving it unanswered pins the arrow to the wrong
   edge in Arabic. */
.rtl .hfj-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
    right: auto !important;
    left: 13px !important;
}

.rtl .hfj-active__label {
    margin-right: 0;
    margin-left: 2px;
}

/* --------------------------------------------------------- small screens -- */

@media (max-width: 767.98px) {
    .hfj-filters {
        border-radius: 14px;
    }

    .hfj-filters__head {
        padding: 12px 14px;
    }

    .hfj-filters__body {
        padding: 14px;
    }

    .hfj-filters__toggle {
        display: inline-flex;
    }

    .hfj-filters.is-collapsed .hfj-filters__body {
        display: none;
    }

    .frontend-wrapper .hfj-filters .select2-container--default .select2-selection--multiple {
        max-height: 104px;
    }

    .hfj-active {
        padding: 12px;
        gap: 8px;
    }

    /* The label owns its own line so the chips get the full width. */
    .hfj-active__label {
        flex: 0 0 100%;
    }

    .hfj-filters__actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .hfj-filters__actions .btn {
        width: 100%;
    }

    /* p-5 is a lot of side padding on a phone. */
    .hfj-empty.p-5 {
        padding: 2.25rem 1.25rem !important;
    }

    .hfj-empty {
        margin-bottom: 50px;
    }

    .hfj-empty__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .frontend-wrapper .hfj-empty__actions .btn {
        width: 100%;
    }

    .hfj-empty__tips-list {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------ reduced motion -- */
/* Every lift in this panel is decoration; the colour and shadow changes carry
   the same information on their own. */

@media (prefers-reduced-motion: reduce) {
    .hfj-filters *,
    .hfj-empty * {
        transition-duration: 0.01ms !important;
    }

    .hfj-filters .hfj-field:hover .form-control:not(.select2-hidden-accessible):not(:focus),
    .hfj-filters .hfj-field .form-control:not(.select2-hidden-accessible):focus,
    .frontend-wrapper .hfj-filters .hfj-field:hover .select2-container--default .select2-selection--single,
    .frontend-wrapper .hfj-filters .hfj-field:hover .select2-container--default .select2-selection--multiple,
    .frontend-wrapper .hfj-filters .select2-container--default.select2-container--focus .select2-selection--single,
    .frontend-wrapper .hfj-filters .select2-container--default.select2-container--focus .select2-selection--multiple,
    .hfj-chip:hover,
    .hfj-tip:hover,
    .hfj-filters__reset:hover,
    .frontend-wrapper .hfj-filters__actions .btn:hover,
    .frontend-wrapper .hfj-empty__actions .hfj-btn-ghost:hover {
        transform: none !important;
    }
}
