/* ======================================================================
   andromeda-combo.css — searchable dropdown (pairs with js/andromeda-combo.js).

   Ships as its own file, loaded globally by _Layout, because the widget is
   used on both andromeda-page views and the older form-control/tj-* views
   that do not link claudio.css. Every token therefore carries a literal
   fallback, so the look holds with or without claudio.css on the page.
   Accent-aware: --andromeda-accent is picked up when claudio.css is present.
   ====================================================================== */

.andromeda-combo {
    position: relative;
    min-width: 160px;
    /* The widget must not inherit the surrounding page's text treatment: it can
       sit on a dark banner or a glass card (Welcome.cshtml sets color:#FFF and a
       text-shadow on the container), which would give white-on-white options. */
    color: #0f1b33;
    text-shadow: none;
}

/* Invisible but NOT display:none — the browser needs a focusable control to
   anchor the native "required" validation bubble to. */
.andromeda-combo > select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
    border: 0;
}

.andromeda-combo-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e3e8f1;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    color: #0f1b33;
    text-align: left;
    cursor: pointer;
}

.andromeda-combo-toggle:hover:not(:disabled) {
    border-color: #b9c5dc;
}

.andromeda-combo-toggle:disabled {
    background: #f4f6fb;
    color: #8892a6;
    cursor: not-allowed;
}

.andromeda-combo.open .andromeda-combo-toggle,
.andromeda-combo-toggle:focus-visible {
    outline: none;
    border-color: var(--andromeda-accent, #004691);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--andromeda-accent, #004691) 18%, transparent);
}

.andromeda-combo.is-invalid .andromeda-combo-toggle {
    border-color: var(--ifi-red, #cb0935);
    box-shadow: 0 0 0 3px rgba(203, 9, 53, 0.12);
}

.andromeda-combo-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.andromeda-combo-caret {
    flex: none;
    color: #6b7a99;
    font-size: 11px;
    transition: transform .15s;
}

.andromeda-combo.open .andromeda-combo-caret {
    transform: rotate(180deg);
}

.andromeda-combo-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    background: #fff;
    color: #0f1b33;
    border: 1px solid #e3e8f1;
    border-radius: 8px;
    box-shadow: var(--shadow2, 0 6px 16px rgba(0, 0, 0, 0.12));
    padding: 6px;
    z-index: 1060; /* above Bootstrap modals — several combos live in one */
    display: none;
}

/* Flipped upwards by the JS when the menu would overflow the viewport. */
.andromeda-combo.up .andromeda-combo-menu {
    top: auto;
    bottom: calc(100% + 4px);
}

.andromeda-combo.open .andromeda-combo-menu {
    display: block;
}

/* Searchable variant: the filter box needs room to be usable. */
.andromeda-combo.searchable .andromeda-combo-menu {
    min-width: 230px;
}

.andromeda-combo-search {
    position: relative;
    margin-bottom: 6px;
}

/* Without [data-searchable] the filter box is not painted, but it stays in the
   DOM and focusable so typing still jumps to a match, like a native <select>. */
.andromeda-combo:not(.searchable) .andromeda-combo-search {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    opacity: 0;
}

.andromeda-combo-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #8c95a8;
    pointer-events: none;
}

.andromeda-combo-search input {
    width: 100%;
    padding: 7px 10px 7px 28px;
    border: 1px solid #e3e8f1;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    color: #0f1b33;
}

.andromeda-combo-search input:focus {
    outline: none;
    border-color: var(--andromeda-accent, #004691);
}

.andromeda-combo-list {
    max-height: 240px;
    overflow-y: auto;
}

.andromeda-combo-opt {
    padding: 8px 9px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    word-break: break-word;
}

.andromeda-combo-opt:hover,
.andromeda-combo-opt.active {
    background: #f3f6fc;
}

.andromeda-combo-opt.selected {
    font-weight: 600;
    color: var(--andromeda-accent, #004691);
}

.andromeda-combo-opt.disabled {
    color: #8c95a8;
    cursor: not-allowed;
}

.andromeda-combo-empty {
    padding: 12px 9px;
    text-align: center;
    font-size: 12.5px;
    color: #8c95a8;
}
