@use './variables-global' as *;

.tab-wrapper {
  display: flex;
}

.tab-header-container {
  display: flex;
  gap: 2px;
  position: relative;

  &::before {
    background-color: #ddd;
    content: "";
    position: absolute
  }
}

.tab-left .tab-header-container,
.tab-right .tab-header-container {
  gap: 2px;
}

.tab-header {
  cursor: pointer;
  transition: 0.3s;
  z-index: 8;
}

.tab-header>span {
  align-items: center;
  display: flex;
  gap: 6px;
  padding: 7px 14px;
}

.tab-header.active {
  color: $primary_color;
}

.tab-card .tab-header {
  background-color: #fff;
  border: solid #ddd;
}

.tab-card .tab-header.active {
  border-color: #2196F3;
}

.tab-header.disabled {
  color: #9e9e9e;
  cursor: not-allowed;
}

.tab-content {
  background: #fff;
  border: solid #ddd;
  flex: 1 0 0;
  padding: 10px 18px;
}

.tab-indicator {
  background-color: $primary_color;
  height: 2px;
  position: absolute;
  transition: 0.3s;
  width: 2px;
  z-index: 9;
}

.tab-top {
  flex-direction: column;

  .tab-header-container::before {
    bottom: 0;
    height: 1px;
    left: 0;
    width: 100%;
  }

  &.tab-card .tab-header {
    border-radius: 2px 2px 0 0;
    border-width: 1px 1px 0 1px;
  }

  .tab-indicator {
    bottom: 0;
  }

  .tab-content {
    border-radius: 0 0 2px 2px;
    border-width: 0 1px 1px 1px;
  }
}

.tab-bottom {
  flex-direction: column-reverse;

  .tab-header-container::before {
    height: 1px;
    left: 0;
    top: 0;
    width: 100%;
  }

  &.tab-card .tab-header {
    border-radius: 0 0 2px 2px;
    border-width: 0 1px 1px 1px;
  }

  .tab-indicator {
    top: 0;
  }

  .tab-content {
    border-radius: 2px 2px 0 0;
    border-width: 1px 1px 0 1px;
  }
}

.tab-left {
  flex-direction: row;

  .tab-header-container {
    flex-direction: column;

    &::before {
      height: 100%;
      right: 0;
      top: 0;
      width: 1px;
    }
  }

  &.tab-card .tab-header {
    border-radius: 2px 0 0 2px;
    border-width: 1px 0 1px 1px;
  }

  .tab-indicator {
    right: 0;
  }

  .tab-content {
    border-radius: 0 2px 2px 0;
    border-width: 1px 1px 1px 0;
  }
}

.tab-right {
  flex-direction: row-reverse;

  .tab-header-container {
    flex-direction: column;

    &::before {
      height: 100%;
      left: 0;
      top: 0;
      width: 1px;
    }
  }

  &.tab-card .tab-header {
    border-radius: 0 2px 2px 0;
    border-width: 1px 1px 1px 0;
  }

  .tab-indicator {
    left: 0;
  }

  .tab-content {
    border-radius: 2px 0 0 2px;
    border-width: 1px 0 1px 1px;
  }
}

.tab-left.tab-line .tab-header>span {
  padding-left: 0;
}

.tab-right.tab-line .tab-header>span {
  padding-right: 0;
}