@import '../bootstrap'
@import '../theme'

/* Theme */
tabs($material)
  .vf-tabs__li
    color: $material.tabs.active

    &.vf-tabs__item--disabled
      color: $material.buttons.disabled

  .vf-tabs__bar
    background-color: $material.cards

    .vf-icon--left,
    .vf-icon--right
      color: $material.icons.inactive

theme(tabs, "vf-tabs__bar")

.vf-tabs
  overflow: hidden
  position: relative
  width: 100%

  &--grow .vf-tabs__bar
    .vf-tabs__li
      flex: 1

  &--fixed > .vf-tabs__bar
    .vf-tabs__li
      min-width: 160px
      max-width: 264px
      flex: 0 1 160px

      @media $display-breakpoints.xs-only
        min-width: 72px

  &--centered .vf-tabs__bar
    .vf-tabs__container
      justify-content: center

  &--icons
    .vf-tabs__bar
      height: 72px

    .vf-tabs__item
      flex-direction: column

  &.vf-tabs--mobile .vf-tabs__bar
    .vf-icon--left, .vf-icon--right
      display: none

    .vf-tabs__wrapper
      &--scrollable.vf-tabs__wrapper--overflow
        overflow: hidden !important

  &:not(.vf-tabs--grow):not(.vf-tabs--mobile)
    .vf-tabs__item
      padding: 0 24px

  &:not(.vf-tabs--centered):not(.vf-tabs--grow):not(.vf-tabs--mobile)
    .vf-tabs__wrapper
      &--scrollable
        margin: 0 60px
        overflow: hidden !important

  &__bar
    width: 100%
    position: relative
    height: 48px

    @media $display-breakpoints.sm-and-down
      padding-left: 0

    .vf-icon--left, .vf-icon--right
      position: absolute
      top: 0
      width: 32px
      align-items: center
      height: 100%
      cursor: pointer
      user-select: none

    .vf-icon--left
      left: 28px

    .vf-icon--right
      right: 28px

  &__container
    display: flex
    height: 100%
    width: 100%
    position: absolute
    padding: 0
    top: 0
    align-items: center
    list-style: none
    will-change: transform
    transition: transform 0.6s cubic-bezier(0.86, 0, 0.07, 1)

    > li:not(.vf-tabs__slider)
      height: 100%

    &-left
      position: absolute
      left: 0
      top: 0
      height: 100%
      width: 32px
      display: flex
      align-items: center

  &__wrapper
    position: relative
    overflow-x: auto
    height: inherit

  &__item
    align-items: center
    color: inherit !important
    display: flex
    flex-shrink: 0
    justify-content: center
    height: 100%
    padding: 0 12px
    position: relative
    opacity: .7
    text-align: center
    text-decoration: none
    text-transform: uppercase
    text-overflow: ellipsis
    white-space: nowrap

    .vf-icon
      color: inherit
      margin: 0 0 5px

    &--active
      opacity: 1

    &--disabled
      pointer-events: none

  &__items
    position: relative
    overflow: hidden

  &__content
    transition: $primary-transition
    width: 100%

    .vf-card
      border-radius: 0 0 2px 2px

  &__slider
    position: absolute
    bottom: 0
    height: 2px
    transition: $primary-transition
