/* ==========================================================================
   Unified Tooltip System - Dark Theme
   ========================================================================== */

.tooltip {
  /* Dark background matching notification system */
  background: rgba(40, 40, 40, 0.95);
  color: #ffffff;
  
  /* Border and shadow for depth */
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  
  /* Rounded corners and spacing */
  border-radius: 6px;
  padding: 6px 10px;
  
  /* Typography */
  font-size: calc(var(--base-font-size, 16px) * 0.9);
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  
  /* Layout */
  max-width: 300px;
  word-wrap: break-word;
  
  /* Positioning (handled by JS) */
  position: absolute;
  z-index: 1300;
  
  /* Accessibility */
  pointer-events: none;
  user-select: none;
  
  /* Smooth transitions */
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

/* Position-specific arrow indicators */
.tooltip::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 5px solid transparent;
}

.tooltip[data-position="top"]::before {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: rgba(40, 40, 40, 0.95);
}

.tooltip[data-position="bottom"]::before {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: rgba(40, 40, 40, 0.95);
}

.tooltip[data-position="left"]::before {
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: rgba(40, 40, 40, 0.95);
}

.tooltip[data-position="right"]::before {
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: rgba(40, 40, 40, 0.95);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .tooltip {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .tooltip {
    transition: none;
  }
}

/* Print styles - hide tooltips */
@media print {
  .tooltip {
    display: none !important;
  }
}

/* Small screen adjustments */
@media (max-width: 768px) {
  .tooltip {
    font-size: calc(var(--base-font-size, 16px) * 0.85);
    padding: 5px 8px;
    max-width: 250px;
  }
}

/* ==========================================================================
   Declarative Tooltip Attributes Usage Examples
   ========================================================================== */

/* 
   Usage examples:
   
   1. Basic tooltip:
      <span data-tooltip="This is a tooltip">Hover me</span>
   
   2. With position preference:
      <span data-tooltip="Top tooltip" data-tooltip-position="top">Top</span>
   
   3. With custom delay:
      <span data-tooltip="Delayed tooltip" data-tooltip-delay="500">Slow</span>
   
   4. Programmatic usage:
      TooltipManager.show(element, "Dynamic content", { position: 'bottom' });
*/
