// Default variables
$font_size: 1 !default;
$font_size_small: 0.75 !default;

$input_border_radius: 0px !default;
$input_height: 44px !default;
$input_height_small: 36px !default;
$dropdown_padding: 6px !default;

$gray_dark: #444 !default;
$gray: #999 !default;
$gray_light: #e8e8e8 !default;
$gray_lighter: #f6f6f6 !default;
$primary_light: $gray !default;
$arrow_color: $gray !default;

// Style the dropdown
.nice-select {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  clear: both;
  cursor: pointer;
  display: block;
  @include font-size($font_size);
  font-weight: normal;
  height: $input_height;
  line-height: $input_height - 2;
  outline: none;
  padding-left: $dropdown_padding;
  padding-right: $dropdown_padding + 12;
  position: relative;
  text-align: left !important;
  transition: all 0.2s ease-in-out;
  user-select: none;
  white-space: nowrap;
  width: auto;
  border-bottom:2px solid #E5E5E5;
  color:$color__tchatbooster_orange;
  &:hover {
    border-color: $color__tchatbooster_orange;
  }
  &:active, &:focus {
    border-color: $color__tchatbooster_orange;
  }
  // Arrow
  &:after { 

    content: '\e907';
    display: block; 
   
    position: absolute; 
    right: 12px; 
    top: 42%;
    font-size:12px; 
    transform-origin: 50% 50%;
    // transform: rotate(45deg);
    transition: all 0.15s ease-in-out;

  }
  
  &.open {
    @extend :active;
    &:after {
      transform: rotate(-180deg);
    }
    .list {
      opacity: 1;
      pointer-events: auto;
      transform: scale(1) translateY(0);
    }
  }
  &.disabled {
    border-color: lighten($gray_light, 2%);
    color: $gray;
    pointer-events: none;
    &:after { 
      border-color: lighten($arrow_color, 20%);
    }
  }
  
  // Modifiers
  &.wide {
    width: 100%;
    .list {
      left: 0 !important;
      right: 0 !important;
    }
  }
  &.right {
    float: right;
    .list {
      left: auto;
      right: 0;
    }
  }
  &.small {
    @include font-size($font_size_small);
    height: $input_height_small;
    line-height: $input_height_small - 2;
    &:after { 
      height: 4px;
      width: 4px;
    }
    .option {
      line-height: $input_height_small - 2;
      min-height: $input_height_small - 2;
    }
  }
  
  // List and options
  .list {
    margin-left:0px;
    padding-left:0px;
    background-color: #fff;
    border:1px solid $color__tchatbooster_orange;
    border-top:none;
    border-radius: $input_border_radius;
    box-sizing: border-box;
    margin-top: 4px;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    position: absolute;
    top: 100%; 
    left: 0;
    transform-origin: 50% 0;
    transform: scale(.75) translateY(- $input_height / 2);
    transition: all .2s cubic-bezier(0.5, 0, 0, 1.25), opacity .15s ease-out;
    z-index: 9;
    &:hover .option:not(:hover) {
      background-color: transparent !important;
    }
    margin-top:2px;
  }
  .option {
    cursor: pointer;
    font-weight: 400;
    line-height: $input_height + 3;
    list-style: none;
    min-height: $input_height - 2;
    outline: none;
    padding-left: $dropdown_padding;
    padding-right: $dropdown_padding + 11;
    text-align: left;
    color:#000;
    transition: all 0.2s;
    &:hover, &.focus, &.selected.focus { 
      background-color: $gray_lighter;
    }
    &.selected { 
      font-weight: 500;
      color:$color__tchatbooster_orange;
    }
    &.disabled {
      background-color: transparent;
      color: $gray;
      cursor: default;
    }
  }

  .wpcf7-form &{
    height:42px;
    background:#fff;
    padding:4px 10px;
    @include box-shadow();

    border-bottom:none;
      .list{
        margin-top:0px;
        border:0px;
        border-top:1px solid #ddd;
      }
  }

  .wysiwyg & .list{
    li{
      &:before{
        display:none;
      }
    }
  }

}

// Use display instead of opacity for IE <= 10
.no-csspointerevents .nice-select {
  .list {
    display: none;
  }
  &.open {
    .list {
      display: block;
    }
  }
}