// 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 {
  display: block;
  padding: $nav-link-padding-y $nav-link-padding-x;

  @include hover-focus {
    text-decoration: none;
  }

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

.nav-tabs {
  .nav-link {
    height:$nav-tabs-height;
    line-height:$nav-tabs-height - $nav-tabs-link-border-width;
    overflow: hidden;
    color: $nav-tabs-link-color;
    border:0;
    border-bottom-width: $nav-tabs-link-border-width;
    border-style:solid;
    border-color:transparent;

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

    @include status-disabled{
      color: $nav-link-disabled-color;
    }

    //close trigger
    .aid-close{
      color:$nav-tabs-close-color;
      margin-left:10px;
      &: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;
    line-height:$nav-pills-height - $nav-tabs-link-border-width;
    overflow: hidden;
    color:$nav-pills-link-color;
    border-top:$nav-tabs-link-border-width solid transparent;
    .aid-close{
      position: absolute;
      right: .5rem;
      top:$nav-tabs-height/2;
      transform: translate(0,-50%);
      z-index: 5;
      margin-left:10px;
      color:$nav-tabs-close-color;
      &:hover{
        color:$nav-tabs-close-hover-color
      }
    }
    //nav-pills separate line
    &::before {
      position: absolute;
      top: 50%;
      left: 0;
      display: block;
      width: 1px;
      height: 16px;
      background: $nav-pills-separate-line-color;
      transform: translateY(-50%);
      content: "";
    }
    //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,0.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;
  }
}


