/* Generic CustomDropdown */
.field-container {
    font-size: 12px !important;
    display: block;
    width: 303px;
    height: 22px;
    padding: 4px;
    color: #666;
    border: 1px solid #6b7786;
    background-color: #fff;
    background-repeat: repeat-x;
    border-radius: 4px;
}

.custom-dropdownlist {
    position: relative;
}

.custom-dropdownlist-expander {
    line-height: 22px;

    width: 99%;

    cursor: pointer;
}

.custom-dropdownlist-expander span:not(.caret) {
    float: left;
}

.custom-dropdownlist-expander .caret {
    display: inline-block;

    width: 0;
    height: 0;
    margin-left: 5px;
    padding-top: 6px;
    position: relative;
    top: 10px;
    float: right;

    content: '';
    vertical-align: middle;

    border-top: 0.3em solid #000;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.custom-dropdownlist-overlay {
    position: absolute;
    z-index: 9999;

    display: flex;
    flex-direction: column;

    box-sizing: border-box;
    min-width: 300px;
    max-width: 900px;

    border: 1px solid #000;
    background-color: #fff;
}

.custom-dropdownlist-overlay.hidden {
    display: none;
    visibility: hidden;
}

.custom-dropdownlist-overlay.reverse {
    bottom: 0;

    flex-direction: column-reverse;
}

.custom-dropdownlist-overlay .overlay-filter {
    z-index: 1;

    width: 94%;
    padding: 4px;

    background-color: #fff;
}

.custom-dropdownlist-overlay .overlay-list {
    overflow-y: auto;

    width: 100%;
    height: auto;
    max-height: 21em;

    background-color: #fff;
}

.custom-dropdownlist-expander label {
    font-weight: normal;

    float: left;
    overflow: hidden;

    max-width: 95%;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.custom-dropdownlist-overlay .overlay-list .overlay-list-item {
    line-height: 26px;
    width: 97%;
    min-height: 28px;
    padding: 4px 0 4px 8px;
    text-align: left;
    white-space: pre;
    display: table;
    clear: both;
}

.custom-dropdownlist-overlay .overlay-list-item.hover {
    cursor: pointer;
    background-color: #f1f3f3;
}

.custom-dropdownlist-overlay *:focus,
.custom-dropdownlist-overlay *:focus-within,
.custom-dropdownlist-overlay *:focus-visible {
    outline-color: #0c5cc5 !important;
}

.overlay-list .overlay-list-item.overlay-list-item-selected {
    background-color: #f1f3f3;
}

.custom-dropdownlist-expander label {
    white-space: pre;
}

.custom-dropdownlist:not(.editing).hover input[type='text'] {
    cursor: pointer;
    background-color: #f1f3f3;
}

.custom-dropdownlist.editing input[type='text'] {
    padding: 0 !important;
}

/* TODO: FIL-34454 would like to delete, if the base CSS can be updated */
#CommonSearchPanel .custom-dropdownlist .overlay-filter input[type='text'],
.custom-dropdownlist .overlay-filter input[type='text'] {
    width: 100%;
}

/* EForm Designer Rule Conditions */
#form-settings-rules .custom-dropdownlist,
#rulesModal .custom-dropdownlist {
    font-size: inherit;

    display: inline-block;

    width: 67%;
    height: 20px;
    padding: 0 0 0 2px;

    vertical-align: top;
}

#form-settings-rules .custom-dropdownlist .custom-dropdownlist-expander,
#rulesModal .custom-dropdownlist .custom-dropdownlist-expander {
    line-height: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%;

    color: #000;
}

#form-settings-rules .custom-dropdownlist .custom-dropdownlist-expander label,
#rulesModal .custom-dropdownlist .custom-dropdownlist-expander label {
    width: 100%;
    max-width: 100%;
}

#form-settings-rules .custom-dropdownlist .caret,
#rulesModal .custom-dropdownlist .caret {
    margin-top: 4px;
    margin-right: -3px;

    border-top-width: 6px;
    border-right-width: 3px;
    border-left-width: 3px;
}

#form-settings-rules .custom-dropdownlist .overlay-filter,
#rulesModal .custom-dropdownlist .overlay-filter,
#form-settings-rules .custom-dropdownlist .overlay-list,
#rulesModal .custom-dropdownlist .overlay-list {
    color: #000;
}

#form-settings-rules .custom-dropdownlist.blank-dropdown,
#rulesModal .custom-dropdownlist.blank-dropdown {
    display: none;
}

/* ViewEdit and Submission (mostly Responsive) Eform */
form[fbdesigner] .custom-dropdownlist {
    width: 100%;
    min-width: 100px;
    min-height: 26px;
    border: 1px solid #6b7786;
}

form[fbdesigner]:not(.fb-responsive-form) .custom-dropdownlist {
    height: 26px;
}

form[fbdesigner] .has-error .custom-dropdownlist {
    color: #fff;
    border: 1px solid #d9534f !important;
    background-color: #d9534f;
}

form[fbdesigner] .has-error .custom-dropdownlist .custom-dropdownlist-overlay {
    color: black;
}

form[fbdesigner] .has-error .custom-dropdownlist .overlay-filter {
    border-color: #fff;
}

form[fbdesigner] .has-error .custom-dropdownlist .overlay-filter input {
    color: #000;
    border-color: #000 !important;
    background-color: #fff;
}

form[fbdesigner] .custom-dropdownlist .custom-dropdownlist-expander {
    line-height: initial;

    position: absolute;
    top: 50%;

    overflow: hidden;

    width: 99%;
    height: 80%;

    transform: translateY(-50%);
}

form[fbdesigner] .custom-dropdownlist-expander label {
    line-height: 20px;

    position: relative;

    float: none;

    min-width: 93%;
    max-width: 93%;
    margin-right: 5%;
    padding-left: .5em;

    text-overflow: ellipsis;
}

form[fbdesigner] .custom-dropdownlist .caret {
    position: absolute;
    top: 7px;
    right: 7px;
    margin: 0;
    padding: 0;
    border-top-width: 5px;
    border-right-width: 4px;
    border-left-width: 4px;
    border-top-color: #000;
}

form[fbdesigner] .custom-dropdownlist .custom-dropdownlist-overlay {
    max-width: 100%;
}

form[fbdesigner] .custom-dropdownlist .overlay-filter {
    width: 100%;
}

.dropdown-toggle label {
    height: 17px !important;
}