/// <reference path="../../_color-definitions.scss" />
/// <reference path="../../_variables.scss" />
/// <reference path="../../_mixins.scss" />

.tk-select {
  padding-left: 0.3125rem;
  padding-right: 0.3125rem;
  padding-bottom: 0.3125rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  font-family: var(--base-font-family, $base-font-family);

  &--no-label {
    padding-top: 1.5rem;
    padding-left: 0.3125rem;
    padding-right: 0.3125rem;
    padding-bottom: 0.3125rem;
  }

  @include show-animation();
}

.tk-select__label {
  padding-left: 0.62rem;
  font-family: var(--base-font-family,'Roboto'), sans-serif;
  font-size: var(--label-font-size, 1rem);
  font-weight: 500;
  letter-spacing: .009375em;
  white-space: nowrap;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

.tk-select__inner {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  display: flex;
  flex-direction: column;
  position: relative;
  height: auto;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  border-radius: $base-border-radius;
  border-radius: var(--select-border-radius, #{$base-border-radius});
}

.tk-select--focused .tk-select__dropdown-icon {
  transform: rotate(-180deg);
}

// @Dennis - i changed from __native-control to __native to make it more consistent
/*.tk-select--focused .tk-select__native {
  border-color: $primary-color;
}*/

.tk-select__native {
  padding: 8px 32px 8px 10px;
  display: block;
  width: 100%;
  min-width: 80px;
  font-family: inherit;
  font-size: 1rem;
  height: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.009375em;
  white-space: nowrap;
  border: 2px solid rgb(224, 224, 224);
  border-radius: $base-border-radius;
  border-radius: var(--select-border-radius, #{$base-border-radius});
  background: #fff;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 200ms linear;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  &:hover {
    border-color: rgba(0,0,0,.87);
    cursor: pointer;
  }

  &:focus {
    cursor: auto;
    border-color: unquote('rgb(var(--primary-color, 33,33,33))');
  }

  &[disabled],
  &[readonly] {
    color: rgb(121,121,121);
    border-color: rgb(224, 224, 224);
    background: #efefef;
    cursor: auto;
    pointer-events: none;
  }

  &::-ms-expand {
    display: none;
  }
}

.tk-select__dropdown-icon {
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='5' viewBox='7 10 10 5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' opacity='.54' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat 50%;
  position: absolute;
  left: auto;
  right: 8px;
  top: 0.875rem;
  width: 12px;
  height: 12px;
  transition: transform .15s cubic-bezier(.4,0,.2,1),-webkit-transform .15s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

.tk-select__native:disabled ~ .tk-select__dropdown-icon {
  opacity: 0.4;
}

.tk-select__native.ng-hide ~ .tk-select__dropdown-icon {
  display: none;
}

.tk-select__validation-state {
  margin-top: 5px;
  font-family: var(--base-font-family, $base-font-family);
  font-size: 0.75rem;
}

.tk-select__inner.dense {

  .tk-select__native {
    padding: 2px 32px 2px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #000;
    background: transparent;
    height: 28px;
  }

  .tk-select__dropdown-icon {
    top: 50%;
    transform: translateY(-50%);
  }
}

