/* Searchable server-type picker (js/egg-picker.js), in the dashboard's create-server form. The list opens
   in the flow of the form (not floating), so the popup's scrolling column never clips it. Inputs stay
   light in both themes, so the list does too. */

.egg-picker-value { display: none; }

.egg-picker-field { position: relative; }

#egg-search {
    padding-right: 2rem;
    background-image: var(--pixel-arrow-down);
    background-repeat: no-repeat;
    background-size: calc(var(--px) * 5) calc(var(--px) * 3);
    background-position: right 0.6rem center;
    cursor: pointer;
}
#egg-search:focus { cursor: text; }
.egg-picker.has-icon #egg-search { padding-left: 2.5rem; }

.egg-picker-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    pointer-events: none;
}

.egg-picker-list {
    max-height: 18rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: var(--border);
    border-top: none;
    background-color: var(--bg-input);
    color: var(--text-input);
}

.egg-picker-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.25rem 0.5rem;
    /* Cream, the content column's colour, on the white list; the list is cream itself in dark mode, so there the
       headings are a deeper cream to stand apart. Quieter than the highlighted option either way. */
    background-color: var(--cream);
    color: var(--navy);
    border-bottom: var(--px) solid var(--navy);
    font-family: var(--f-pixel);
    font-size: 1rem;
    text-transform: uppercase;
}

body.dark-mode .egg-picker-heading { background-color: color-mix(in srgb, var(--cream) 75%, var(--gold)); }

.egg-picker-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    font-size: var(--fs-md);
    line-height: 1.25;
}
.egg-picker-option.active {
    background-color: var(--btn-secondary);
    color: var(--text-on-accent);
}
.egg-picker-option[aria-selected="true"] { font-weight: 700; }

.egg-picker-option img,
.egg-picker-icon img,
.egg-picker-placeholder {
    flex: none;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Eggs without an icon: their first letter in a pixel box, so names stay aligned. */
.egg-picker-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--lilac);
    color: var(--navy);
    font-family: var(--f-pixel);
    font-size: 0.75rem;
    box-shadow: inset 0 0 0 var(--px) var(--navy);
}

.egg-picker-empty {
    padding: 0.5rem;
    color: var(--plum-grey);
}
