/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../mixins/tooltip.less';
@import '../custom.less';
@import './vars.less';

@tooltip-prefix-cls: ~'@{css-prefix}tooltip';

.@{tooltip-prefix-cls} {
  .inject-Tooltip-vars();

  white-space: pre-wrap;

  &:focus:hover,
  &:focus:not(.focusing) {
    outline-width: 0;
  }

  &__content-wrapper {
    overflow: auto;
  }

  &&__popper {
    position: absolute;
    left: -9999px;
    border-radius: var(--tv-Tooltip-popper-border-radius);
    padding: var(--tv-Tooltip-padding-y) var(--tv-Tooltip-padding-x);
    font-size: var(--tv-Tooltip-popper-font-size);
    line-height: var(--tv-Tooltip-popper-font-line-height);
    min-width: 10px;
    max-width: 450px;
    z-index: 2000;
    word-wrap: break-word;
    box-shadow: var(--tv-Tooltip-box-shadow);

    &.is-normal {
      .tooltip-type(
        var(--tv-Tooltip-popper-normal-text-color),
        var(--tv-Tooltip-popper-normal-bg-color),
        var(--tv-Tooltip-popper-normal-border-color)
      );
    }

    &.is-info {
      .tooltip-type(
        var(--tv-Tooltip-popper-info-text-color),
        var(--tv-Tooltip-popper-info-bg-color),
        var(--tv-Tooltip-popper-info-border-color)
      );
    }

    &.is-error {
      .tooltip-type(
        var(--tv-Tooltip-popper-error-text-color),
        var(--tv-Tooltip-popper-error-bg-color),
        var(--tv-Tooltip-popper-error-border-color)
      );

      .tooltip-validate-icon {
        fill: var(--tv-Tooltip-validate-icon-color);
        margin-right: 8px;
      }
    }

    &.is-warning {
      .tooltip-type(
        var(--tv-Tooltip-popper-warning-text-color),
        var(--tv-Tooltip-popper-warning-bg-color),
        var(--tv-Tooltip-popper-warning-border-color)
      );
    }

    &.is-success {
      .tooltip-type(
        var(--tv-Tooltip-popper-success-text-color),
        var(--tv-Tooltip-popper-success-bg-color),
        var(--tv-Tooltip-popper-success-border-color)
      );
    }

    &.is-dark {
      .tooltip-type(
        var(--tv-Tooltip-popper-dark-text-color),
        var(--tv-Tooltip-popper-dark-bg-color),
        var(--tv-Tooltip-popper-dark-border-color)
      );
    }

    &.is-light {
      .tooltip-type(
        var(--tv-Tooltip-popper-light-text-color),
        var(--tv-Tooltip-popper-light-bg-color),
        var(--tv-Tooltip-popper-light-border-color)
      );
    }

    &.is-blank-content {
      display: none;
    }
  }
}
