/**
 * Copyright (c) Enalean, 2020-Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

@use "./dropdown";
@use "./search";
@use "./option";
@use "./predefined-template";
@use "./selection";

/**
* We can't just display: none or add the attribute type="hidden" because we need the <select> for accessibility purpose.
* Hence, we shrink it at the maximum.
*/
.list-picker-hidden-accessible {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    white-space: nowrap;

    &:invalid {
        box-shadow: none;
    }

    &[multiple] {
        height: 0;
    }
}

.list-picker-component-wrapper {
    display: inline-block;
    box-sizing: border-box;
    width: 100%;
    line-height: normal;
}

.list-picker {
    z-index: 2003;
}

.list-picker-in-multiple-mode {
    width: 100%;
}

.list-picker-disabled {
    border-color: var(--tlp-form-element-border-color);
    cursor: not-allowed;
}

.list-picker-selection,
.list-picker-search-field {
    transition: border-color var(--tlp-form-element-border-transition-duration) linear;

    &:focus {
        transition:
            border-color var(--tlp-form-element-border-transition-duration) linear,
            box-shadow 350ms;
        border-color: var(--tlp-main-color);
        box-shadow: var(--tlp-shadow-focus);
    }
}

.list-picker-placeholder {
    color: var(--tlp-form-element-placeholder-color);
}

.list-picker-multiple {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    height: 100%;
    padding: 0;
}
