/* ==============================================
   TOOLTIP STYLES - Customize here
   ============================================== */

/* Tooltip container (shared) */
.tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
  box-sizing: border-box;
  
  /* --- Customize these --- */
  padding: 8px 12px;
  background: var(--color-blue);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  border-radius: 0px;
  white-space: nowrap;
  
  /* Initial state */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 150ms ease,
    visibility 150ms ease,
    width 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Inner text element with slide animation */
.tooltip__text {
  display: block;
  transform: translateY(0);
  opacity: 1;
  transition:
    transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Text sliding out (up) */
.tooltip__text.is-slide-out {
  transform: translateY(-100%);
  opacity: 0;
}

/* Text entering from bottom (instant positioning, no transition) */
.tooltip__text.is-slide-in-start {
  transform: translateY(100%);
  opacity: 0;
  transition: none !important;
}

/* --- Customize offset from cursor --- */
.tooltip--follow {
  /* Offset applied via JS */
}

/* View count inside tooltip */
.tooltip__views {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  vertical-align: middle;
}

.tooltip__views svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* Bump animation when view count updates in real-time */
.tooltip__views.is-bumped {
  animation: viewBump 300ms ease;
}

@keyframes viewBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* --- Fixed tooltip (for links): auto-center via transform --- */
.tooltip--fixed {
  transform: translateX(-50%);
}
