@import '../../../styles/var.less';

.tab-focus() {
  background-color: var(--color-bg-subtle);
  // 添加内阴影
  box-shadow: inset 0px -2px 0px var(--color-primary);

  .icon {
    opacity: 1;
  }
}

.tab-focus-line() {
  color: var(--color-primary);
  background-color: var(--color-hover-bg);

  .icon {
    display: flex;
  }
}

.tabBox {
  display: flex;
  flex-direction: column;
}

.tabsNav {
  display: flex;
  overflow-x: hidden;
  position: relative;
  height: 32px;
  flex-shrink: 0;
  background-color: var(--color-hover-bg);
  border-bottom: 1px solid var(--color-border);
  &:hover {
    overflow-x: scroll;
  }
  &::-webkit-scrollbar {
    display: none;
  }
}

.tabsContent {
  flex: 1;
  height: 0px;

  .tabsContentItem {
    height: 100%;
    width: 100%;
    display: none;
    position: relative;
  }

  .tabsContentItemActive {
    display: block;
  }
}

.activeContent {
  display: block;
}

.tabList {
  display: flex;
}

.tabItem {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 10px;
  line-height: 32px;
  height: 32px;
  cursor: pointer;
  user-select: none;
  border-right: 1px solid var(--color-border);

  &:last-child {
    border-right: 0;
  }

  .textBox {
    flex: 1;
    display: flex;
    align-items: center;
  }
  .untracked {
    color: var(--color-error);
  }
  .saved {
    // color: var(--red);
  }
  .change {
    // color: var(--color-warning);
    color: var(--color-success);
  }

  .text {
    flex: 1;
    width: fit-content;
    .f-single-line();
  }

  .icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 0px 4px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--color-text-secondary);
    opacity: 0;

    i {
      font-size: 12px;
    }

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

  &:hover {
    // .tab-focus();
    // color: var(--color-primary);
    background-color: var(--color-hover-bg);
    .icon {
      opacity: 1;
    }
  }
}

.activeTab {
  .tab-focus();
}

.rightBox {
  // flex: 1;
  position: sticky;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: var(--color-bg-base);
  // box-shadow: -1px 0 4px rgba(0, 0, 0, 0.1);
  display: flex;
}

.moreTabs {
  width: 30px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-left: 1px solid var(--color-border);

  &:hover {
    color: var(--color-primary);
  }
}

.addIcon {
  width: 30px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-left: 1px solid var(--color-border);

  &:hover {
    color: var(--color-primary);
  }
}

.addIconDisabled {
  color: var(--color-text-disabled);
  cursor: not-allowed;
  &:hover {
    color: var(--color-text-disabled);
  }
}

.input {
  border: 0;
  width: 86px;
  flex: 1;
  height: 20px;
  outline: none;
  font-size: 12px;
  font-weight: 400;
  background-color: var(--color-bg-subtle);
  color: var(--color-text);

  input:focus {
    outline: none;
  }
}

.prefixIcon {
  flex-shrink: 0;
  margin-right: 4px;
}
