/**
 * tooltips.css
 * High-performance, rich glassmorphic tooltip system for HexSettlers.
 * Engineered for clarity, tabletop strategy immersion, and responsiveness.
 */

#global-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  max-width: 320px;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7),
              0 4px 12px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 14px;
  color: #f8fafc;
  font-family: var(--font-main, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.97);
  transition: opacity 0.14s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.14s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.14s;
  will-change: transform, opacity;
}

#global-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Tooltip Header */
.tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}

.tooltip-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13.5px;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.tooltip-icon {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tooltip-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  white-space: nowrap;
}

/* Tooltip Body Content */
.tooltip-body {
  font-size: 12.5px;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.tooltip-body p {
  margin: 0 0 4px 0;
}

.tooltip-body p:last-child {
  margin-bottom: 0;
}

.tooltip-body .highlight {
  color: #fef08a;
  font-weight: 600;
}

.tooltip-body .accent-blue {
  color: #93c5fd;
  font-weight: 600;
}

.tooltip-body .accent-green {
  color: #86efac;
  font-weight: 600;
}

.tooltip-body .alert-text {
  color: #fca5a5;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 4px;
}

/* Tooltip Footer Meta & Requirements */
.tooltip-meta {
  font-size: 11.5px;
  color: #94a3b8;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 5px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tooltip-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tooltip-meta-key {
  color: #94a3b8;
}

.tooltip-meta-val {
  color: #f8fafc;
  font-weight: 600;
}

.tooltip-pips-row {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

.tooltip-pip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444;
}

.tooltip-pip-dot.regular {
  background: #94a3b8;
}

/* Theme Accents */
#global-tooltip.theme-gold {
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7),
              0 0 16px rgba(234, 179, 8, 0.15);
}
#global-tooltip.theme-gold .tooltip-title-wrap {
  color: #fef08a;
}
#global-tooltip.theme-gold .tooltip-badge {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

#global-tooltip.theme-danger {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7),
              0 0 16px rgba(239, 68, 68, 0.15);
}
#global-tooltip.theme-danger .tooltip-title-wrap {
  color: #fca5a5;
}
#global-tooltip.theme-danger .tooltip-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

#global-tooltip.theme-science {
  border-color: rgba(34, 197, 94, 0.4);
}
#global-tooltip.theme-science .tooltip-title-wrap {
  color: #86efac;
}
#global-tooltip.theme-science .tooltip-badge {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

#global-tooltip.theme-politics {
  border-color: rgba(59, 130, 246, 0.4);
}
#global-tooltip.theme-politics .tooltip-title-wrap {
  color: #93c5fd;
}
#global-tooltip.theme-politics .tooltip-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

#global-tooltip.theme-trade {
  border-color: rgba(245, 158, 11, 0.4);
}
#global-tooltip.theme-trade .tooltip-title-wrap {
  color: #fde68a;
}
#global-tooltip.theme-trade .tooltip-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Subtle Cursor Indicator on elements with tooltips */
[data-tooltip], [data-tooltip-title] {
  cursor: help;
}

/* Interactive buttons keep pointer cursor */
button[data-tooltip], button[data-tooltip-title],
a[data-tooltip], a[data-tooltip-title],
.interactive-node[data-tooltip], .edge-group[data-tooltip],
.hex-group[data-tooltip] {
  cursor: pointer;
}

/* Disabled elements with tooltips still trigger tooltips with not-allowed cursor */
button:disabled[data-tooltip], button:disabled[data-tooltip-title],
[disabled][data-tooltip], [disabled][data-tooltip-title] {
  cursor: not-allowed;
  pointer-events: auto !important;
}

