/* Pure CSS Tooltip for abbr tags */
abbr[data-custom-tooltip] {
  position: relative;
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

/* Base state (Hidden) */
abbr[data-custom-tooltip]::after {
  content: attr(data-custom-tooltip);
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translate(-50%, 10px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);

  background-color: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  /* Softer, modern radius */
  font-size: 0.75rem;
  line-height: 1.5;
  font-weight: normal; /* Prevents inheriting bold from parent text */
  white-space: normal;
  width: max-content;
  max-width: 350px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  /* Elegant drop shadow */
}

/* Tooltip Arrow (Hidden) */
abbr[data-custom-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: 2px;
  transform: translate(-50%, 10px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);

  border: 7px solid transparent;
  border-top-color: var(--md-default-bg-color);
  /* Matches tooltip background */
  z-index: 1001;
  /* Above the border to blend */
  pointer-events: none;
  filter: drop-shadow(0px 2px 1px rgba(0, 0, 0, 0.05));
}

/* Hover state (Visible & Animated) */
abbr[data-custom-tooltip]:hover::after,
abbr[data-custom-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}