/* 
 * ========================================================================
 * UNIFIED GLOBAL DROPDOWN CSS
 * ========================================================================
 * Standardizes: Choices.js, Bootstrap Selectpicker, TomSelect, Select2, 
 * and Custom Keyword Search Wrapper to look 100% identical.
 */

/* -----------------------------------------------------------
 * 1. BASE CONTAINER & INPUT (Closed State)
 * Height: 50px | Border-radius: 8px | Padding: 10px 14px
 * ----------------------------------------------------------- */

/* A. Choices.js */
.choices[data-type*="select-one"] .choices__inner {
    height: 50px !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0 14px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
    font-size: 15px !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
}

.choices[data-type*="select-one"]:hover .choices__inner {
    border-color: #cbd5e1 !important;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: #0073d1 !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 209, 0.1) !important;
}

/* B. Bootstrap Select (Selectpicker) */
.bootstrap-select .dropdown-toggle {
    height: 50px !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0 14px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
    font-size: 15px !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
}

.bootstrap-select:hover .dropdown-toggle {
    border-color: #cbd5e1 !important;
}

.bootstrap-select.show .dropdown-toggle,
.bootstrap-select .dropdown-toggle:focus {
    border-color: #0073d1 !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 209, 0.1) !important;
    outline: none !important;
}

/* C. TomSelect */
.ts-wrapper .ts-control {
    height: 50px !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0 14px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
    font-size: 15px !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
}

.ts-wrapper:not(.disabled):hover .ts-control {
    border-color: #cbd5e1 !important;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
    border-color: #0073d1 !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 209, 0.1) !important;
}

/* D. Custom Keyword Wrapper Input */
.home-keyword-search-wrapper input.home-keyword-search-input,
.filter-job-input-box {
    height: 50px !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0 14px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
    font-size: 15px !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.home-keyword-search-wrapper input.home-keyword-search-input:hover,
.filter-job-input-box:hover {
    border-color: #cbd5e1 !important;
}

.home-keyword-search-wrapper input.home-keyword-search-input:focus,
.filter-job-input-box:focus {
    border-color: #0073d1 !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 209, 0.1) !important;
    outline: none !important;
}

/* -----------------------------------------------------------
 * 2. DROPDOWN ARROW / CARET
 * Normalize the dropdown arrow for all
 * ----------------------------------------------------------- */

/* Hide native arrows and add custom */
.choices[data-type*="select-one"]::after,
.bootstrap-select .dropdown-toggle::after,
.ts-wrapper::after {
    content: "" !important;
    position: absolute !important;
    right: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-top: 6px solid #64748b !important;
    border-bottom: none !important;
    margin: 0 !important;
    display: block !important;
    pointer-events: none !important;
    transition: transform 0.2s ease !important;
}

/* Rotate arrow on open */
.choices.is-open[data-type*="select-one"]::after,
.bootstrap-select.show .dropdown-toggle::after,
.ts-wrapper.dropdown-active::after {
    transform: translateY(-50%) rotate(180deg) !important;
}

/* Remove old carets from Bootstrap Select */
.bootstrap-select .dropdown-toggle .caret {
    display: none !important;
}

/* Fix text positioning in select controls */
.choices__list--single,
.bootstrap-select .filter-option-inner-inner,
.ts-control .item {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding-right: 20px !important;
    line-height: normal !important;
}

/* Placeholder colors */
.choices__placeholder,
.bootstrap-select .bs-placeholder .filter-option-inner-inner,
.ts-control input::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}

/* -----------------------------------------------------------
 * 3. DROPDOWN PANEL (The popup list)
 * ----------------------------------------------------------- */

/* Universal Dropdown Container styling */
.choices__list--dropdown,
.bootstrap-select .dropdown-menu,
.ts-dropdown,
.home-keyword-suggestions {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    margin-top: 6px !important;
    padding: 0 !important;
    overflow: hidden !important;
    z-index: 1050 !important;
}

/* Ensure Lists scroll properly */
.choices__list[dir="ltr"],
.bootstrap-select .inner,
.ts-dropdown .ts-dropdown-content,
.home-keyword-list {
    max-height: 260px !important;
    overflow-y: auto !important;
    padding: 4px 0 !important;
}

/* -----------------------------------------------------------
 * 4. SEARCH BAR INSIDE DROPDOWN
 * ----------------------------------------------------------- */

/* Container */
.choices__list--dropdown .choices__input,
.bootstrap-select .bs-searchbox input,
.ts-dropdown .dropdown-input,
.home-keyword-searchbar input {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease !important;
    box-shadow: none !important;
    outline: none !important;
}

.choices__list--dropdown .choices__input:focus,
.bootstrap-select .bs-searchbox input:focus,
.home-keyword-searchbar input:focus {
    border-color: #0073d1 !important;
}

.bootstrap-select .bs-searchbox {
    padding: 0 !important;
}
.home-keyword-searchbar {
    padding: 0 !important;
    border-bottom: 1px solid #eef2f7 !important;
}

/* -----------------------------------------------------------
 * 5. DROPDOWN LIST ITEMS
 * ----------------------------------------------------------- */

/* Individual Item Styles */
.choices__item--choice,
.bootstrap-select .dropdown-menu li a,
.ts-dropdown .option,
.home-keyword-suggestion-item {
    padding: 12px 16px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    font-weight: 500 !important;
    background: transparent !important;
    border-bottom: 1px solid #f1f5f9 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    display: block !important;
    text-align: left !important;
}

.choices__item--choice:last-child,
.bootstrap-select .dropdown-menu li:last-child a,
.ts-dropdown .option:last-child,
.home-keyword-suggestion-item:last-child {
    border-bottom: none !important;
}

/* Hover and Focus States */
.choices__item--choice.is-highlighted,
.choices__item--choice:hover,
.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li a:focus,
.ts-dropdown .active,
.home-keyword-suggestion-item:hover,
.home-keyword-suggestion-item.active {
    background-color: #f0f7ff !important;
    color: #0073d1 !important;
}

/* Selected State */
.choices__item--choice.is-selected,
.bootstrap-select .dropdown-menu li.selected a,
.ts-dropdown .selected {
    background-color: #e0f2fe !important;
    color: #0073d1 !important;
    font-weight: 600 !important;
}

/* -----------------------------------------------------------
 * 6. NO RESULTS / LOADING
 * ----------------------------------------------------------- */
.choices__list--dropdown .choices__item--selectable.has-no-choices,
.choices__list--dropdown .choices__item--selectable.has-no-results,
.bootstrap-select .no-results,
.ts-dropdown .no-results,
.home-keyword-no-results,
.home-keyword-loading {
    padding: 14px 16px !important;
    text-align: center !important;
    font-size: 13px !important;
    color: #64748b !important;
    background: transparent !important;
    font-style: italic !important;
}

/* -----------------------------------------------------------
 * 7. SPECIAL OVERRIDES & FIXES
 * ----------------------------------------------------------- */
/* Fix Job Page / Job Header Icon Alignment */
.filler-job-form {
    position: relative;
}
.filler-job-form > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #0073d1;
    z-index: 2;
    pointer-events: none;
}
.filler-job-form .choices[data-type*="select-one"] .choices__inner,
.filler-job-form .filter-job-input-box,
.filler-job-form .home-keyword-search-wrapper input.home-keyword-search-input {
    padding-left: 42px !important;
}

/* Make sure the Keyword Input from .home-keyword-search-wrapper in hero does not get messed up if used without icons */
.tr-hero-search-field .home-keyword-search-wrapper input.home-keyword-search-input {
    padding-left: 0 !important; /* overrides previous padding if in hero */
    height: auto !important;
    min-height: 30px !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Ensure Bootstrap Select buttons inherit proper styles without native BS btn classes clashing */
.bootstrap-select > .dropdown-toggle {
    text-transform: none !important;
}
.bootstrap-select .dropdown-menu li a span.text {
    display: block !important;
}

/* Override Jobzilla Theme's default height changes */
.jobs-top-filter .filter-group .bootstrap-select.form-control .dropdown-toggle {
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 14px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
}

.job-list-header .choices[data-type*="select-one"] .choices__inner {
    border-radius: 8px !important;
}
