/**
 * v3 careerweb — filters modal styles.
 * Centered dialog on desktop with a backdrop blur. Bottom-sheet
 * variant on mobile lives in responsive.css.
 */

.filters-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    pointer-events: none;
}
.filters-modal.open {
    display: block;
    pointer-events: auto;
}
.filters-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14, 14, 14, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 200ms ease;
}
.filters-modal.open .filters-backdrop { opacity: 1; }
.filters-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    width: calc(100% - 32px);
    max-width: 480px;
    max-height: calc(100vh - 64px);
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translate(-50%, -48%) scale(0.96);
    opacity: 0;
    transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.filters-modal.open .filters-dialog {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.filters-header h2 {
    font-family: 'Archivo', sans-serif;
    font-weight: 800;
    font-size: 22px;
    margin: 0;
    color: var(--ink);
    letter-spacing: -0.02em;
}
.filters-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.filter-field { margin-bottom: 20px; }
.filter-field:last-child { margin-bottom: 0; }
.filter-label {
    display: block;
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    font-size: 11px;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.filter-input,
.filter-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    font-family: inherit;
    transition: all 150ms ease;
}
.filter-input::placeholder { color: var(--ink-3); }
.filter-input:hover,
.filter-select:hover { border-color: var(--ink-3); }
.filter-input:focus,
.filter-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A847B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 40px;
    cursor: pointer;
}
[data-theme="dark"] .filter-select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A299' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.filters-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.btn-clear {
    padding: 11px 18px;
    background: var(--surface-2);
    color: var(--ink);
    border: none;
    border-radius: var(--radius);
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 120ms ease;
    white-space: nowrap;
}
.btn-clear:hover { background: var(--surface-3); }

/* ─── Searchable combobox (js/v3/combobox.js) ───
   Grafted onto the f-job-location and f-companies <select>s in the
   filters modal. The original <select> is hidden but stays in the DOM
   for form-collection; this UI is what the user actually drives. */
.combobox {
    position: relative;
}
.combobox-input {
    width: 100%;
    height: 44px;
    padding: 0 38px 0 14px;  /* right pad leaves room for the clear btn */
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    font-family: inherit;
    transition: all 150ms ease;
}
.combobox-input::placeholder { color: var(--ink-3); }
.combobox-input:hover { border-color: var(--ink-3); }
.combobox-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.combobox-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--ink-3);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.combobox-clear:hover {
    background: var(--surface-2);
    color: var(--ink);
}
.combobox-clear i { font-size: 16px; }
.combobox-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 10;
    padding: 4px;
}
.combobox-option {
    padding: 10px 12px;
    font-size: 13.5px;
    color: var(--ink);
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1.3;
    user-select: none;
    transition: background 80ms ease;
}
.combobox-option:hover,
.combobox-option--active {
    background: var(--surface-2);
}
.combobox-option--active {
    /* Brand-tinted highlight when keyboard-active so it reads
       differently from a hover pass with the mouse. */
    background: var(--brand-tint);
    color: var(--ink);
}
.combobox-empty {
    padding: 16px 12px;
    font-size: 13px;
    color: var(--ink-3);
    text-align: center;
}

/* ─── Google Maps Places autocomplete dropdown ───
   The Places dropdown (.pac-container) is appended to <body>, so we
   reach over the filters-modal stacking context to keep it on top.
   Styling is restrained — Maps' default look would clash against the
   v3 tokens, but heavy overrides risk breaking when Google ships
   internal markup changes. Keep this small. */
.pac-container {
    z-index: 200;  /* above .filters-modal (100) */
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-top: 4px;
    padding: 4px 0;
    font-family: 'Geist', -apple-system, sans-serif;
    overflow: hidden;
}
.pac-item {
    padding: 8px 14px;
    font-size: 13.5px;
    color: var(--ink);
    border: none;
    cursor: pointer;
    line-height: 1.4;
}
.pac-item:hover,
.pac-item-selected { background: var(--surface-2); }
.pac-item-query {
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
}
.pac-matched { color: var(--brand); font-weight: 600; }
.pac-icon { display: none; }  /* the marker icon is decorative; we ship Tabler everywhere else */
[data-theme="dark"] .pac-item { color: var(--ink); }
