$tab-content-border:          0 1px 0 0 #ddd, 0 0 1px 0 #ddd, 0 0 1px 1px #ddd !default;
$tab-border:                  solid 1px #ddd;
$tab-border-radius:           2px 2px 0 0 !default;
$tab-margin:                  0.3125rem !default;
$tab-arrow-bg-gradient:     rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.3) !default;
$tab-arrow-bg-gradient-alt: rgba(235, 244, 255, 0.4), rgba(235, 244, 255, 0.3) !default;

.ta-tabs {
  background-color: $ta-grey100;
  max-width: 100%;
  padding: $spacing-2xl;

  .arrows {
    max-width: 100%;
    position: relative;
  }

  .scrollMenu {
    max-height: $spacing-4xl;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }

  span {
    &#leftArrow,
    &#rightArrow {
      top: $spacing-md;
      height: $spacing-2xl;
      min-height: fit-content;
      width: fit-content;
      min-width: 2.5rem;
      position: absolute;
      z-index: 2;

      &::before {
        font-family: $cardinalicon-font-family;
        color: $blue;
      }
    }

    &#leftArrow {
      background-image: linear-gradient(to right, $tab-arrow-bg-gradient);
      left: $spacing-sm;
      margin-left: -$spacing-sm;

      &::before {
        content: $ta-left-icon;
      }
    }

    &#rightArrow {
      background-image: linear-gradient(to left, $tab-arrow-bg-gradient);
      right: $spacing-sm;
      margin-right: -$spacing-sm;

      &::before {
        content: $ta-right-icon;
      }
    }
  }

  li {
    padding: 0;
  }

  .tabRow {
    align-items: center;
    display: flex;
    list-style: none;
    margin-bottom: $spacing-md;
    padding: 0;
    width: fit-content;
  }

  .tab {
    align-items: center;
    border-radius: $tab-border-radius;
    -webkit-box-align: center;
    color: $ta-grey700;
    cursor: pointer;
    display: inherit;
    height: auto;
    width: auto;
    max-height: $spacing-4xl;
    margin-right: $tab-margin;
    margin-left: $tab-margin;
    margin-top: $tab-margin;
    margin-bottom: -$spacing-md;
    padding: $spacing-md $spacing-lg;
    position: relative;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    outline: none;

    &:first-of-type {
      margin-left: 0;
    }

    // once tab key is clicked, highlights / outlines are avalable again when the mouse is used.
    &:focus {
      outline: none; /* keyboard-only focus styles */
    }

    &.userTabbing:focus {
      box-shadow: 0 0 2px 2px rgba(3, 97, 164, 0.3); /* keyboard-only focus styles */
    }

    &::before {
      content: " ";
      background: $ta-white100;
      border-radius: $tab-border-radius;
      display: block;
      height: $spacing-md;
      position: absolute;
      bottom: -1px;
      left: 0;
      transform: translateY(100%);
      transition-duration: 0s;
      width: 100%;
    }

    a,
    a:hover,
    a:active,
    a:link,
    a:visited {
      color: $ta-grey700;
      cursor: pointer;
      font-size: $label-font-size;
      line-height: 1.29;
      text-align: center;
      text-transform: capitalize;
      text-decoration: none;
    }

    a:active {
      cursor: default !important;
    }

    &:hover {
      &::before {
        background: $ta-grey300;
        transform: translateY(50%);
      }
    }
  }

  .active {
    align-items: center;
    background: $ta-white100;
    border-bottom: none;
    border: $tab-border;
    -webkit-box-align: center;
    color: $ta-grey800;
    cursor: default;
    display: inherit;
    margin-right: $tab-margin;
    margin-left: $tab-margin;
    margin-top: $tab-margin;
    text-align: center;
    vertical-align: middle;
    width: auto;
    z-index: 1;

    &::before {
      background: $ta-white100;
      border-bottom: none;
      bottom: 1px;
    }

    &:hover {
      &::before {
        background: $ta-white100;
      }
    }

    a,
    a:hover,
    a:active,
    a:link,
    a:visited {
      color: $ta-grey800;
      cursor: pointer;
      text-decoration: none;
    }

    a,
    a:active {
      cursor: default !important;
    }
  }

  .tabContent {
    background: $ta-white100;
    border-image: initial;
    border-radius: 2px;
    box-shadow: $tab-content-border;
    width: 100%;
    padding: $spacing-xl $spacing-lg;
    position: relative;
  }

  //secondary color way
  &.-secondaryTabs {
    background-color: $ta-white100;

    &.-backgroundNone {
      background-color: transparent;
      padding: $spacing-sm $spacing-none;

      &.tabRow {
        background-color: transparent;
      }
    }
  }

  //tertiary color way
  &.-tertiaryTabs {
    background-color: $ta-blue100;

    span {
      &#leftArrow {
        background-image: linear-gradient(to right, $tab-arrow-bg-gradient-alt);
      }

      &#rightArrow {
        background-image: linear-gradient(to left, $tab-arrow-bg-gradient-alt);
      }
    }

    .tabRow {
      background-color: $ta-blue100;
    }

    .tab {
      background: transparent;
      color: $ta-blue500;

      &::before {
        background: $ta-white100;
      }

      a,
      a:hover,
      a:active,
      a:link,
      a:visited {
        color: $ta-blue500;
      }

      &:hover {
        &::before {
          background: $ta-blue200;
          transform: translateY(50%);
        }
      }
    }

    .active {
      background: $ta-white100;
      color: $ta-grey800;

      &:hover {
        &::before {
          background: $ta-white100;
        }
      }

      a,
      a:hover,
      a:active,
      a:link,
      a:visited {
        color: $ta-grey800;
      }
    }

    .tabContent {
      background: $ta-white100;
    }
  }
}
