/*
 * Copyright (c) 2026, Salesforce, Inc.,
 * All rights reserved.
 * For full license text, see the LICENSE.txt file
 */

/**
 * Tooltip base — paint surface for the theme layer.
 *
 * The tooltip should be positioned with JavaScript. Tooltips on
 * focusable triggers must also be available on keyboard focus, and
 * the trigger element needs `aria-describedby` pointing at the
 * tooltip's `id` for screen-reader access.
 *
 * Reads only canonical `--slds-c-tooltip-*` hooks. Concrete values
 * live in `themes/<theme>.css`. The nested-icon foreground forward
 * (tooltip surface inverts icon color) lives in each theme file
 * inside `@layer theme`.
 */

.slds-popover_tooltip {
  width: auto;
  max-width: var(--slds-c-tooltip-sizing-max-width);
  background-color: var(--slds-c-tooltip-color-background);
  border: 0;
  box-shadow: var(--slds-c-tooltip-shadow);

  .slds-popover__body {
    font-size: var(--slds-c-tooltip-font-size);
    color: var(--slds-c-tooltip-color-foreground);
  }
}

/**
 * Toggles on tooltip
 */
.slds-rise-from-ground {
  visibility: visible;
  opacity: 1;
  transform: translate(0%, 0%);
  transition:
    opacity 0.1s linear,
    visibility 0.1s linear,
    transform 0.1s linear;
  will-change: transform;
}

/**
 * Toggles off tooltip
 */
.slds-fall-into-ground {
  visibility: hidden;
  opacity: 0;
  transform: translate(0%, 0%);
  transition:
    opacity 0.1s linear,
    visibility 0.1s linear,
    transform 0.1s linear;
  will-change: transform;
}

/**
 * Slides tooltip from bottom to top
 */
.slds-slide-from-bottom-to-top {
  transform: translateY(10%);
  will-change: transform;
}

/**
 * Slides tooltip from top to bottom
 */
.slds-slide-from-top-to-bottom {
  transform: translateY(-10%);
  will-change: transform;
}

/**
 * Slides tooltip from right to left
 */
.slds-slide-from-right-to-left {
  transform: translateX(5%);
  will-change: transform;
}

/**
 * Slides tooltip from left to right
 */
.slds-slide-from-left-to-right {
  transform: translateX(-5%);
  will-change: transform;
}
