.dds-tooltip {
  position: absolute;
  font-size: 14px;
  text-align: left;
  color: $dds-color-carbon-darkest;
  padding: 16px;
  background: $dds-color-white;
  z-index: 2000;
  max-width: 450px;
  border: 1px solid $dds-color-gray-light;
  opacity: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  line-height: initial;

  &:after {
    content: "";
    position: absolute;
    border-style: solid;
  }

  &.bold-border {
    border: 2px solid $dds-color-carbon-lighter;
  }

  @include dds-tooltip-colors();
}

.dds-tooltip-top {
  &:before, &:after {
    top: 100%;
    left: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
  }

  &:before {
    border-color: rgba(228, 228, 228, 0);
    border-top-color: $dds-color-gray-light;
    border-width: 8px;
    margin-left: -8px;
  }

  &:after {
    border-color: rgba(255, 255, 255, 0);
    border-top-color: $dds-color-white;
    border-width: 7px;
    margin-left: -7px;
  }
}

.dds-tooltip-bottom {
  &:before, &:after {
    bottom: 100%;
    left: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
  }

  &:before {
    border-color: rgba(228, 228, 228, 0);
    border-bottom-color: $dds-color-gray-light;
    border-width: 8px;
    margin-left: -8px;
  }

  &:after {
    border-color: rgba(255, 255, 255, 0);
    border-bottom-color: $dds-color-white;
    border-width: 7px;
    margin-left: -7px;
  }
}

.dds-tooltip-right {
  &:before, &:after {
    right: 100%;
    top: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
  }

  &:before {
    border-color: rgba(228, 228, 228, 0);
    border-right-color: $dds-color-gray-light;
    border-width: 8px;
    margin-top: -8px;
  }

  &:after {
    border-color: rgba(255, 255, 255, 0);
    border-right-color: $dds-color-white;
    border-width: 7px;
    margin-top: -7px;
  }
}

.dds-tooltip-left {
  &:before, &:after {
    left: 100%;
    top: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
  }

  &:before {
    border-color: rgba(228, 228, 228, 0);
    border-left-color: $dds-color-gray-light;
    border-width: 8px;
    margin-top: -8px;

    &.dds-tooltip-critical {
      border-left-color: $dds-color-danger;
    }
  }

  &:after {
    border-color: rgba(255, 255, 255, 0);
    border-left-color: $dds-color-white;
    border-width: 7px;
    margin-top: -7px;
  }
}

.dds-tooltip-show {
  opacity: 1;
}


.dds-tooltip-bottom {
  @include dds-tooltip-colors('bottom');
}
.dds-tooltip-left {
  @include dds-tooltip-colors('left');
}
.dds-tooltip-top {
  @include dds-tooltip-colors('top');
}
.dds-tooltip-right {
  @include dds-tooltip-colors('right');
}
