@import "./mixins.less";

@singleSelectGray: #e5ded9;
@singleSelectGrayLight: lighten(@singleSelectGray, 8%);

.module-single-select {
    position: relative !important;

    .module-single-select-box {
        background-color: #fff;
        border: 1px solid @singleSelectGray;
        cursor: default;
        height: 33px;
        font-size: 16px;
        overflow: hidden;
        padding: 9px 45px 0 15px;
        position: relative;
        .border-radius(4px);

        &-btn {
            background-color: @singleSelectGrayLight;
            border-left: 1px solid @singleSelectGray;
            bottom: 0;
            position: absolute;
            right: 0;
            top: 0;
            width: 35px;
            .border-radius(0 4px 4px 0);
            .transition();

            &::after {
                border-left: 5px solid transparent;
                border-right: 5px solid transparent;
                border-top: 5px solid #333;
                content: '';
                height: 0;
                left: 50%;
                margin: -2.5px 0 0 -5px;
                position: absolute;
                top: 50%;
                width: 0;
                .transition();
            }
        }
    }

    .module-single-select-list {
        border: 1px solid @singleSelectGray;
        border-top: none;
        margin: 0;
        padding: 0;
        overflow-y: auto;
        .border-radius(0 0 4px 4px);

        &-container {
            display: none;
            left: 0;
            overflow: hidden;
            position: absolute;
            right: 0;
            top: 100%;
            z-index: 9999;
            .transition(height, .2s);

            .animate-on-click& {
                display: block;
                height: 0;
            }
        }

        li {
            background-color: #fff;
            border-bottom: 1px solid #e5ded9;
            cursor: pointer;
            line-height: 1.2;
            list-style: none;
            margin: 0;
            padding: 10px 15px;

            &:last-child {
                border: none;
                .border-radius(0 0 4px 4px);
            }

            &:hover {
                background-color: @singleSelectGrayLight;
            }
        }
    }

    &.module-single-select-active {
        .module-single-select-box {
            cursor: pointer;
            .border-radius(4px 4px 0 0);

            &-btn {
                background-color: @singleSelectGray;
                border-radius: 0;

                &::after {
                    .rotate(180deg);
                }
            }
        }
    }
}
