*[class^=birthday-picker]{
  box-sizing: border-box;
}

.birthday-picker{
  $char-size: 20px;
  $primary-color: #007BFF;
  $line-color: rgba(0,0,0,0.1);


  font-family: Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  display: inline-block;
  min-width: 8em;
  min-height: 2.5em;
  border: 1px solid $line-color;
  border-radius: 3px;
  padding: 0;
  background-color: transparent;
  vertical-align: middle;

  &.disabled{
    pointer-events: none;
    .birthday-picker_dropdown{ background-color: #E9ECEF;}
  }
  .disabled{
    opacity: 0.3;
    pointer-events: none;
  }

  table{
    width: 100%;
  }

  td{
    text-align: center;

    a{
      display: block;
      padding: 5px;
      border-radius: $char-size;
      cursor: pointer;
      border: 1px solid transparent;
      transition: background-color 0.2s;
      color: inherit;
      text-decoration: none;

      &:hover{ background-color: rgba(0,0,0,0.1); }
      &.bdp-today{ border-color: rgba(0,0,0,0.1); }
      &.bdp-active{
        background-color: $primary-color;
        color: #fff;
        &:hover{ background-color: darken($primary-color, 10%); }
      }
    }
  }


  input{
    position: absolute;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    top:0;
    left:0;
    bottom:0;
    right: 0;
    padding: 0.375rem 0.75rem;
    border: 0;
    border-radius: 5px;
  }


  &_dropdown-body{
    display: flex;
    flex-direction: row;
  }
  &_days-months{
    display: flex;
    flex-direction: row;
  }

  &_days,
  &_months,
  &_years{
    padding: 0 2px;
  }
  &_days{
    flex-grow: 2;
  }
  &_months{
    flex-grow: 1;
    border-right: 1px solid $line-color;
    border-left: 1px solid $line-color;
  }

  &_dropdown{
    display: block;
    padding: 0;
    text-align: left;
    font-size: $char-size*0.75;

    position: absolute;
    background-color: #fff;
    border: 1px solid $line-color;
    border-radius: 0 0 3px 3px;
    box-shadow: 2px 2px 10px $line-color;
    z-index: 1001;

    &.attach-top{     bottom:100%; }
    &.attach-bottom{  top:100%; }
    &.attach-left{    left:0; }
    &.attach-right{   right:0; }

    &-header{
      background-color: $primary-color;
      color: #fff;
      padding: 10px;
      text-align: right;
      font-size: 1.2em;
      font-weight: 300;
      font-family: Roboto, Helvetica, Arial, sans-serif;
    }
  }

  &_high{
    .birthday-picker_dropdown-body{ flex-direction: column; }
    .birthday-picker_months{ border-right: none; }
    .birthday-picker_years{  border-top: 1px solid $line-color; }
  }


  &_carriage{
    position: absolute;
    top: 5px;
    right: 10px;
    width: 10px;
    height: calc(100% - 2*5px);
    pointer-events: none;
    text-align: left;
    transition: transform 0.3s;

    &:after{
      content: '';
      position: absolute;
      top: calc(50% - 2px);
      width: 0;
      height:0;
      border:5px solid transparent;
      border-top-color: #000;
    }
    &.bp-opened{
      transform: rotate(180deg);
    }
  }

  // INLINE
  &_inline{
    input, .birthday-picker_carriage{ display: none; }

    .birthday-picker_dropdown{
      position: relative;
      z-index: inherit;
      box-shadow: none;
      border: none;
    }
  }

}


.dropdown-trans-enter,
.dropdown-trans-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}
.dropdown-trans-enter-to,
.dropdown-trans-leave {
  opacity: 1;
  transform: translateY(0);
}
.dropdown-trans-enter-active,
.dropdown-trans-leave-active {
  transition: opacity 100ms ease-out, transform 100ms ease-out;
}
