/**
 * @author    SWM
 * @copyright 2025 SWM
 * @license   https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 or later
 */

.help-tip {
  position: relative;
  display: inline-block;
  cursor: help;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.help-tip .dashicons {
  color: #787c82;
  font-size: 16px;
  width: 16px;
  height: 16px;
  transition: color 0.2s ease;
}

.help-tip:hover .dashicons,
.help-tip:focus .dashicons {
  color: #2271b1;
}

.help-tip::before {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1d2327;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 250px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.help-tip::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1d2327;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 10001;
}

.help-tip:hover::before,
.help-tip:hover::after,
.help-tip:focus::before,
.help-tip:focus::after {
  opacity: 1;
  visibility: visible;
}

.help-tip--bottom::before {
  bottom: auto;
  top: calc(100% + 8px);
}

.help-tip--bottom::after {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: #1d2327;
}

.help-tip--left::before {
  bottom: auto;
  left: auto;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

.help-tip--left::after {
  bottom: auto;
  left: auto;
  right: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: #1d2327;
}

.help-tip--right::before {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

.help-tip--right::after {
  bottom: auto;
  left: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: #1d2327;
}
