@import "../common/typography/text.mixins.scss";

:host {
  @include theme-text-colors();
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: relative;
  &.disabled {
    .novo-tab-link {
      opacity: 0.5;
      cursor: not-allowed;
    }
    &:hover {
      .novo-tab-link {
        opacity: 0.5;
      }
    }
  }
  .novo-tab-link {
    @include novo-label-text();
    font-size: var(--font-size-tab);
    padding: $spacing-md;
    display: flex;
    align-items: center;
    gap: $spacing-xs;
    cursor: pointer;
    text-transform: uppercase;
    &:focus {
      outline: none;
    }
  }
  .indicator {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 3px;
    display: block;
    background: transparent;
    transition: all 220ms ease-in-out;
  }
  &.active,
  &.router-link-active {
    .novo-tab-link {
      opacity: 1;
      font-weight: 500;
    }
    .indicator {
      background: var(--focus);
      width: 100%;
    }
  }
  &:hover {
    .novo-tab-link {
      opacity: 1;
    }
  }
  &:focus {
    outline: none;
  }
}

:host-context(novo-nav[direction="vertical"]) {
  display: flex;
  width: 100%;
  flex-direction: row;
  align-items: center;
  min-width: 12rem;
  justify-content: space-between;
  transition: all 120ms ease-in-out;
  .novo-tab-link {
    order: 2;
    flex: 1;
    width: 100%;
    display: flex;
    flex-flow: row nowrap;
    gap: $spacing-xs;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.75;
  }
  .indicator {
    order: 1;
    width: 4px;
    height: 0;
    display: block;
    background: transparent;
    transition: all 220ms ease-in-out;
  }
  &.active,
  &.router-link-active {
    background: rgba(0, 0, 0, 0.05);
    .novo-tab-link {
      opacity: 1;
    }
    .indicator {
      height: 100%;
      top: 0;
      bottom: 0;
    }
  }
  &:hover {
    .novo-tab-link {
      opacity: 1;
    }
  }
  &.disabled {
    .novo-tab-link {
      opacity: 0.5;
      cursor: not-allowed;
    }
    &:hover {
      .novo-tab-link {
        opacity: 0.5;
      }
    }
  }
}

:host-context(novo-nav[theme="white"]) {
  height: auto;
  &.disabled {
    .novo-tab-link {
      opacity: 0.5;
      cursor: not-allowed;
    }
    &:hover {
      .novo-tab-link {
        opacity: 0.5;
        font-weight: 400;
      }
    }
  }
  .novo-tab-link {
    color: var(--text-main);
    opacity: 0.75;
  }
  &.active,
  &.router-link-active {
    color: var(--selection);
    .novo-tab-link {
      color: var(--selection);
      opacity: 1;
    }
    .indicator {
      background: currentColor;
    }
  }
  &:hover {
    .novo-tab-link {
      font-weight: 500;
    }
  }
}


:host-context(novo-nav[theme="color"]),
:host-context(novo-nav[theme="neutral"]) {
  .novo-tab-link {
    color: #fff;
  }
  &.active,
  &.router-link-active {
    .indicator {
      background: #fff;
    }
  }
  &.disabled {
    .novo-tab-link {
      opacity: 0.5;
      cursor: not-allowed;
    }
    &:hover {
      .novo-tab-link {
        opacity: 0.5;
      }
    }
  }
}

:host-context(novo-nav.condensed) {
  font-size: 1rem;
  .novo-tab-link {
    padding: $spacing-sm;
  }
}
