/* Search Field
----------------------------------------------------------------------- */
.tr-search-chosen-item-remove {
    color: $delete;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1px;
    cursor: pointer;
    background: none;
    border: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    &:hover, &:active {
        color: $delete_hover;
    }

    &:focus {
        color: $delete_hover;
        outline: none;
        box-shadow: none;
        text-shadow: 0 0 7px $delete;
    }
}

.tr-search-results {
    margin: 0;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
    list-style: none;
    padding: 0;
    border-radius: 3px;

    > li:only-child {
        border-radius: 3px;
    }

    > li:first-child {
        border-radius: 3px 3px 0 0;
    }

    > li:last-child {
        border-radius: 0 0 3px 3px;
    }

}

.tr-search-result-title {
    color: #666;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    padding: 8px;
    margin: 3px 0 0;
    border: solid $gray_border 1px;
    background: #fff;
}

.tr-search-input {
    background: none;
    outline: none;

    &:focus {
        outline: none;
    }
}

.tr-search-chosen-item,
.tr-search-result {
    color: $wp_link;
    color: var(--tr-profile-color);
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
    margin: 0;
    border: solid $gray_border 1px;
    border-top: none;
    background: #eee;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;

    span {
        font-weight: normal;
        color: $gray_dark;

        b {
            font-weight: bold;
            color: $blue;
            color: var(--tr-profile-color);
        }
    }

    &:hover, &:focus, &:active {
        background: $wp_link;
        background: var(--tr-profile-color);
        color: #fff;
        outline: none;
        -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
        box-shadow: inset 0 1px 2px rgba(0,0,0,.07);

        span {
            font-weight: normal;
            color: #fff;

            b {
                font-weight: bold;
                color: #fff;
            }
        }

    }
}

.tr-search-selected {
    padding: 5px 32px 5px 7px;
    margin-top: 5px;
    font-size: 14px;
    border: 1px solid $gray_border;
    font-weight: normal;
    background: #fff;
    position: relative;
    border-radius: 3px;
}

/* Search Field - Multiple
----------------------------------------------------------------------- */
.tr-search-multiple {
    padding: 6px;
    border-radius: 3px;
    border: 1px solid $gray_border;
    display: flex;

    .tr-search-controls,
    .tr-search-selected {
        width: 50%;
        flex: 1;
        display: block;
        margin: 0;
        padding: 0;
        border: none;
        background: transparent;
        box-sizing: border-box;
    }

    .tr-search-controls {
        padding-right: 3px;
    }

    .tr-results-placeholder {
        display: none;
    }

    .tr-search-selected {
        list-style: none;
        padding-left: 3px;

        &:empty:after {
            content: attr(data-placeholder);
            display: block;
            border: solid $gray_border 1px;
            padding: 5px;
            border-radius: 3px;
        }

        > li {
            cursor: move;
            position: relative;
            padding: 5px 32px 5px 7px;
            margin: 0;
            border: solid $gray_border 1px;
            border-top: none;

            &:first-child {
                border-top: solid $gray_border 1px;
            }

            span {
                cursor: pointer;
            }

            &:focus {
                text-decoration: underline;
            }

            &.tr-search-chosen-item.tr-ui-sortable-helper {
                border-top: solid $gray_border 1px;
            }
        }
    }

    &:after {
        content: '';
        display: block;
        clear: both;
    }
}