@use '../../../styles/scss-utils/placeholder.scss' as *;

$_gutter: 2px;
$_text-variant-top-padding: 15px;

.Root {
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;

  &.is-variant-text {
    background-color: var(--theme-color-bg-2);
  }
}

.Buttons {
  display: flex;

  .Root.is-variant-default & {
    margin-left: -$_gutter;
    padding: 2px;
  }

  .Root.is-variant-text & {
    padding: $_text-variant-top-padding 15px 13px;
  }

  .Root.is-variant-sidebar & {
    margin-left: -$_gutter;
  }
}

.Button {
  cursor: pointer;
  user-select: none;

  .Root.is-variant-default & {
    background-color: var(--theme-color-bg-3);
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 1;
    border: none;
    padding: 15px;
    margin-left: $_gutter;
    transition: background-color var(--speed-quick) var(--easing-base);
    color: var(--theme-color-fg-default);

    > p {
      transition: color var(--speed-quick) var(--easing-base);
    }

    &.is-active {
      background-color: var(--theme-color-bg-2) !important;

      > p {
        color: var(--theme-color-fg-highlight);
      }
    }

    &:hover {
      background-color: var(--theme-color-bg-2);
    }
  }

  .Root.is-variant-text & {
    @extend %reset-styles;
    font-weight: var(--font-weight-semibold);
    background-color: transparent;
    margin-right: 32px;

    > p {
      color: var(--theme-color-fg-default-shy);
      font-size: 14px;
      position: relative;
      transition: color var(--speed-quick) var(--easing-base);

      &:after {
        content: '';
        position: absolute;
        top: -$_text-variant-top-padding;
        height: 1px;
        background-color: var(--theme-color-fg-highlight);
        left: 0;
        right: 0;
        opacity: 0;
        transition: opacity var(--speed-quick) var(--easing-base);
      }
    }

    &.is-active > p {
      color: var(--theme-color-fg-highlight);

      &:after {
        opacity: 1;
      }
    }
  }

  .Root.is-variant-sidebar & {
    background-color: var(--theme-color-bg-3);
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 1;
    border: none;
    padding: 12px 16px;
    margin-left: $_gutter;
    color: var(--theme-color-fg-default);
    transition: color var(--speed-quick) var(--easing-base);

    &.is-active {
      background-color: var(--theme-color-bg-1);

      & > p {
        color: var(--theme-color-fg-highlight) !important;
      }
    }

    &:hover > p {
      color: var(--theme-color-fg-default-contrast);
    }
  }
}

.TabContent {
  flex: 1;
  overflow: hidden overlay;
}

.KeepAliveTab {
  width: 100%;
  height: 100%;
}
