@element: 'select';
@import (multiple) 'theme.less';

:host {
  display: inline-flex;
  flex-direction: row;

  position: relative;
  outline: none;
  flex: none;
  box-sizing: border-box;

  margin: 0 0.25em 0 0;
  width: auto;
  min-width: 20px;
  border: 1px solid @el_border_color;
  border-radius: @border_radius;

  cursor: pointer;
  background-image: linear-gradient(@bg_top_color, @bg_bottom_color);
}

select {
  font-family: @page_font;
  /* font-weight: @font_weight; */

  -webkit-appearance: none;
  display: flex;
  flex: 1;
  outline: none;

  border: 0;
  margin: 0;

  padding: 0.2em 2.0em 0.2em 0.8em;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: @border_radius;

  text-decoration: none;
  text-overflow: ellipsis;

  cursor: pointer;
  color: @text_color;
  background: none;

  width: 100%;
}

select option {
  color: @text_color;
  background: @bg_color;
}

:host::after {
  display: block;
  content: ' ';
  position: absolute;
  top: 50%;
  right: 0.8em;
  pointer-events: none;

  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 7px solid @text_color;
  margin-top: -3px;
}

:host(:hover) {
  background-image: linear-gradient(@bg_top_color + 10%, @bg_bottom_color + 10%);

  select {
    color: @text_color_hover;
  }

  &::after {
    border-top-color: @text_color_hover;
  }
}

:host([focused]) {
  border-color: @focus_color;
}

:host([unnavigable]) {
  border-color: @el_border_color;
}

:host([is-disabled]) {
  pointer-events: none;

  border-color: @el_border_color + 20%;
  background-image: linear-gradient(@bg_top_color - 10%, @bg_bottom_color - 10%);

  select {
    color: @text_color - 90%;
  }

  &::after {
    border-top-color: @text_color - 90%;
  }
}

/*-------------------
        Size
--------------------*/

:host(.mini) select {
  font-size: @mini;
}
:host(.mini)::after {
  right: 0.5em;
}

:host(.tiny) select {
  font-size: @tiny;
}
:host(.tiny)::after {
  right: 0.6em;
}

:host(.small) select {
  font-size: @small;
}

:host select {
  font-size: @medium;
}

:host(.large) select {
  font-size: @large;
}

:host(.big) select {
  font-size: @big;
}

:host(.huge) select {
  font-size: @huge;
}

:host(.massive) select {
  font-size: @massive;
}
