/*
 * Copyright (C) 2017-2019 Dremio Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:global {
  .textWithHelp {
    display: flex;
    align-items: baseline;
    position: relative; // for tooltip, which is absolutely positioned
    overflow: hidden;

    &__content {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    &__tooltip {
      left: 100%;
      top: 0;
      width: auto !important;
      max-width: 450px;
      white-space: pre-line !important;
      word-wrap: break-word;

      &.--light {
        background-color: var(--color--neutral--700) !important;
        color: white !important;
      }

      &.--white {
        background-color: var(--fill--popover) !important;
        color: var(--text--primary) !important;
      }
    }

    // Todo: Clean up Tooltip component to use less instead of inline styles and add the color property there instead
    &__tooltipArrow {
      &.--bottom:after {
        top: 1px;
        border-width: 0 4px 5px;
      }
      &.--top:after {
        bottom: 1px;
        border-width: 5px 4px 0;
      }

      &.--light {
        &.--top {
          border-color: var(--color--neutral--700) transparent transparent
            transparent !important;
          &:after {
            border-color: var(--color--neutral--700) transparent transparent
              transparent;
          }
        }
        &.--bottom {
          border-color: transparent transparent var(--color--neutral--700)
            transparent !important;
          &:after {
            border-color: transparent transparent var(--color--neutral--700)
              transparent;
          }
        }
        &:after {
          content: "";
          position: absolute;
          margin-left: -4px;
          width: 0;
          height: 0;
          border-style: solid;
        }
      }
    }
  }
}
