/* Source tooltip fix - ensures tooltips don't overlap */

/* Override the tooltip behavior for source badges */
.source-badge {
  position: relative;
}

/* Reset any existing tooltip styles */
.source-badge::after,
.source-badge::before {
  display: none;
}

/* Create new tooltip using data attributes for better control */
.source-badge .tooltip {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--surface);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

/* Source badge main tooltip */
.source-badge .tooltip.main-tooltip {
  content: 'Click to filter by this source';
}

/* Exclude button tooltip */
.source-badge .tooltip.exclude-tooltip {
  content: attr(data-tooltip);
  right: 0;
  left: auto;
  transform: none;
  z-index: 11; /* Higher z-index to appear above the source badge tooltip */
}

/* Show tooltips on hover */
.source-badge:hover .tooltip.main-tooltip {
  opacity: 1;
}

.source-badge .exclude-button:hover + .tooltip.exclude-tooltip {
  opacity: 1;
}

/* Hide main tooltip when hovering over buttons */
.source-badge .source-actions:hover ~ .tooltip.main-tooltip,
.source-badge .exclude-button:hover ~ .tooltip.main-tooltip {
  opacity: 0 !important;
}

/* JavaScript will add these tooltips to the DOM */