// Base class
//
// Kickstart any navigation component with a set of style resets. Works with
// `<nav>`s or `<ul>`s.

.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav-link {

  @include hover-focus {
    text-decoration: none;
  }
  display: block;
  padding: 0 12px;

  // Disabled state lightens text and removes hover/tab effects
  &.disabled {
    color: $nav-link-disabled-color;
    cursor: $cursor-disabled;
  }
}

.nav-tabs {
  // .nav-item{
  //   margin-right: 24px;
  //   &:last-child  {
  //     margin-right: 0;
  //   }
  // }
  .nav-link {

    @include hover-focus {
      color: $nav-tabs-link-hover-color;
    }

    @include status-disabled {
      color: $nav-link-disabled-color;
    }
    height: $nav-tabs-height;
    overflow: hidden;
    line-height: $nav-tabs-height - $nav-tabs-link-border-width;
    color: $nav-tabs-link-color;
    border: 0;
    border-color: transparent;
    border-style: solid;
    border-bottom-width: $nav-tabs-link-border-width;

    //close trigger
    .#{$icon-prefix}-close {
      margin-left: 10px;
      color: $nav-tabs-close-color;

      &:hover {
        color: $nav-tabs-close-hover-color;
      }
    }
  }

  .nav-link.active, .nav-item.show .nav-link {
    color: $nav-tabs-link-hover-color;
    border-color: $brand-primary;
  }
}

.nav-pills {
  .nav-link {
    position: relative;
    height: $nav-pills-height;
    overflow: hidden;
    line-height: $nav-pills-height - $nav-tabs-link-border-width;
    color: $nav-pills-link-color;
    border-top: $nav-tabs-link-border-width solid transparent;

    .#{$icon-prefix}-close {
      position: absolute;
      top: $nav-tabs-height / 2;
      right: 16px;
      z-index: 5;
      margin-left: 10px;
      color: $nav-tabs-close-color;
      transform: translate(0, -50%);

      &:hover {
        color: $nav-tabs-close-hover-color;
      }
    }
    //nav-pills separate line
    &::before {
      position: absolute;
      top: 50%;
      left: 0;
      display: block;
      width: 1px;
      height: 16px;
      content: "";
      background: $nav-pills-separate-line-color;
      transform: translateY(-50%);
    }
    //text mask
    // &::after{
    //   position: absolute;
    //   top:2px;
    //   bottom:2px;
    //   right:2px;
    //   content: "";
    //   width:$nav-pills-text-cutoff-mask-width;
    //   background-image: linear-gradient(270deg, $nav-pills-bg 22%, rgba($nav-pills-bg,0) 100%);
    //   pointer-events: none;
    // }
    &:hover {
      color: $nav-pills-link-hover-color;
    }
  }

  .nav-link.active,
  .nav-item.show .nav-link {
    z-index: 2;
    color: $nav-pills-link-active-color;
    background-color: $nav-pills-link-active-bg;
    border-color: $nav-tabs-link-active-border-color;

    &::before {
      display: none;
    }
    //text mask
    &::after {
      background-image: linear-gradient(270deg, #fff 22%, rgba(248, 249, 250, .00) 100%);
    }
  }

  .nav-item {
    margin-left: -1px;

    &:first-child .nav-link {
      &::before {
        display: none;
      }
    }
  }
}


//
// Justified variants
//

.nav-fill {
  .nav-item {
    flex: 1 1 auto;
    text-align: center;
  }
}

.nav-justified {
  .nav-item {
    flex-basis: 0;
    flex-grow: 1;
    text-align: center;
  }
}


