@use '../utils' as *;
/*----------------------------------------*/
/*  2.8 Nice Select
/*----------------------------------------*/

.nice-select{
	background-color: #F9F9F9;
	border-radius: 6px;
	border: solid 1px #EDEDED;
	clear: both;
	cursor: pointer;
	display: block;
	font-size: 14px;
	height: 34px;
	line-height: 33px;
	outline: none;
	padding-left: 14px;
	padding-right: 28px;
	position: relative;
	text-align: left !important;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	white-space: nowrap;
	width: auto;
    font-weight: 500;
    color: #4B5563;
    @extend %transition;
    @extend %ff-roboto;

    &:hover{
        border-color: #dbdbdb;
    }

    &:active,
    &.open,
    &:focus{
        border-color: var(--magicai-theme-primary);
    }

    &::after{
        position: absolute;
		content: url('../img/icons/arrow-down.svg');
        top: 50%;
        right: 16px;
		color: var(--magicai-common-black);
		font-weight: 500;
        pointer-events: none;
        -webkit-transition: all 0.15s ease-in-out;
        transition: all 0.15s ease-in-out;
		margin-top: 0;
		transform-origin: center;
		@include transform(translateY(-50%));
		margin-top: -1px;
    }

    &.open{
        &::after{
            @include transform(translateY(-50%) rotate(-180deg));
        }

        & .list{
            overflow-y: scroll;
            height: 225px;
            opacity: 1;
            pointer-events: auto;
            @include transform(perspective(300px) rotateX(0deg));
        }
    }

    &.disabled{
        border-color: #ededed;
        color: #999;
        pointer-events: none;

        &::after{
            border-color: #cccccc;
        }
    }

    &.wide{
        width: 100%;

        & .list{
            left: 0 !important;
	        right: 0 !important;
        }
    }

    &.right{
        float: right;

        & .list{
            left: auto;
	        right: 0;
        }
    }
    
    &.small{
        font-size: 12px;
        height: 36px;
        line-height: 34px;

        &::after{
            height: 4px;
	        width: 4px;
        }

        & .option{
            line-height: 34px;
	        min-height: 34px;
        }
    }

    & .list{
        width: 100%;
        background-color: #fff;
        border-radius: 6px;
        box-shadow: 0 0 0 1px rgba(68, 68, 68, 0.11);
        box-sizing: border-box;
        margin-top: 0px;
        opacity: 0;
        overflow: hidden;
        padding: 0;
        pointer-events: none;
        position: absolute;
        top: 100%;
        left: 0;
        -webkit-transform-origin: top;
        -ms-transform-origin: top;
        transform-origin: top;
        @include transform(perspective(300px) rotateX(-18deg));
        @include transition-mul((all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out));
        z-index: 9;
    }

    & .option{
        cursor: pointer;
        font-weight: 400;
        line-height: 40px;
        list-style: none;
        min-height: 40px;
        outline: none;
        padding-left: 18px;
        padding-right: 29px;
        text-align: left;
        @include transition(all, 0.2s);

        &.selected{
            font-weight: bold;
        }

        &.disabled{
            background-color: transparent;
            color: #999;
            cursor: default;
        }
    }

}

.no-csspointerevents .nice-select .list {
	display: none;
}

.no-csspointerevents .nice-select.open .list {
	display: block;
}
