@import '../abstract/_all';

.tabs {
  ul {
    display: flex;
    margin: 0;
    flex-grow: 1;
    flex-shrink: 0;

    &.content-start {
      justify-content: flex-start;
    }

    &.content-center {
      align-items: center;
    }
  }

  li {
    position: relative;
    display: block;
    margin: 0;
    list-style: none;

    a,
    span,
    .tab {
      overflow: hidden;
      border-radius: 50px;
      display: flex;
      justify-content: center;
      align-items: center;
      vertical-align: top;
      cursor: pointer;
      padding: 8px 16px;
      line-height: 1;
      border: 1px solid #000000;
    }

    &.is-active .tab,
    &.is-active span,
    &.is-active a {
      position: relative;
      background-color: $c-accent;
      color: #ffffff;

      border: 1px solid $c-accent;
    }
  }

  &.is-center ul {
    justify-content: center;
  }

  &.is-around ul {
    justify-content: space-around;

    li {
      flex: 1;
    }
  }

  .list-equal {
    display: flex;
    align-items: flex-end;

    li {
      flex-grow: 1;
    }
  }

  .has-light & {
    li::after {
      background-color: #fff;
    }
  }
}

.tabs-inline {
  ul {
    display: flex;
    margin: 0;
    flex-grow: 1;
    flex-shrink: 0;

    &.content-start {
      justify-content: flex-start;
    }

    &.content-center {
      align-items: center;
    }
  }

  li {
    display: block;
    margin: 0;

    a,
    span,
    button {
      display: flex;
      justify-content: center;
      align-items: center;
      vertical-align: top;
      font-size: 12px;
      cursor: pointer;
    }

    &.is-active a,
    &.is-active span,
    &.is-active button {
      position: relative;

      &::after {
        content: '';
        position: absolute;
        width: 4px;
        height: 4px;
        background-color: $c-primary;
        bottom: 0;
      }
    }

    &::after {
      display: none;
    }
  }

  &.is-center ul {
    justify-content: center;
  }

  &.is-around ul {
    justify-content: space-around;

    li {
      flex: 1;
    }
  }

  .list-equal {
    display: flex;
    align-items: flex-end;

    li {
      flex-grow: 1;
    }
  }
}

.tabs-list,
.tabs-clear li {
  display: block;
  width: 100%;
  margin: 0;

  span,
  a {
    position: relative;
    cursor: pointer;

    &::after {
      content: '';
      position: absolute;
      width: 100%;
      background: $c-primary;
      height: 2px;
      bottom: -4px;
      left: 0;
    }

    &:hover::after {
      background: $c-primary;
    }
  }
}
