/**
 * Brøndr Tooltip Styles
 * Modern, accessible tooltip system with smooth animations
 */

/* Tooltip Container */
.tooltip-container {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
}

/* Base Tooltip Styles */
.tooltip {
  position: absolute;
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 10px 14px;
}

.tooltip-visible {
  opacity: 1;
  transform: scale(1);
}

/* Tooltip Content */
.tooltip-content {
  /* padding: 10px 14px; */
  position: relative;
  z-index: 2;
}

/* Tooltip Arrow */
.tooltip-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  z-index: 1;
}

/* Arrow Positions */
.tooltip-top .tooltip-arrow {
  bottom: -6px;
  left: 50%;
  margin-left: -6px;
}

.tooltip-bottom .tooltip-arrow {
  top: -6px;
  left: 50%;
  margin-left: -6px;
}

.tooltip-left .tooltip-arrow {
  right: -6px;
  top: 50%;
  margin-top: -6px;
}

.tooltip-right .tooltip-arrow {
  left: -6px;
  top: 50%;
  margin-top: -6px;
}

/* Dark Theme (Default) */
.tooltip-dark {
  background: rgba(45, 45, 45, 0.98);
  color: rgb(242, 241, 237);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-dark .tooltip-arrow {
  background: rgba(45, 45, 45, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light Theme */
.tooltip-light {
  background: rgba(255, 255, 255, 0.98);
  color: rgb(29, 29, 29);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.tooltip-light .tooltip-arrow {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* Primary Theme (Brand Color) */
.tooltip-primary {
  background: linear-gradient(
    135deg,
    rgba(224, 70, 13, 0.98) 0%,
    rgba(196, 61, 11, 0.98) 100%
  );
  color: rgb(242, 241, 237);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-primary .tooltip-arrow {
  background: rgba(224, 70, 13, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Success Theme */
.tooltip-success {
  background: rgba(34, 197, 94, 0.98);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-success .tooltip-arrow {
  background: rgba(34, 197, 94, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Warning Theme */
.tooltip-warning {
  background: rgba(234, 179, 8, 0.98);
  color: rgb(29, 29, 29);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.tooltip-warning .tooltip-arrow {
  background: rgba(234, 179, 8, 0.98);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* Error Theme */
.tooltip-error {
  background: rgba(239, 68, 68, 0.98);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-error .tooltip-arrow {
  background: rgba(239, 68, 68, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Info Theme */
.tooltip-info {
  background: rgba(59, 130, 246, 0.98);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-info .tooltip-arrow {
  background: rgba(59, 130, 246, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Tooltip Content Styling */
.tooltip-content strong {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.tooltip-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.tooltip-content li {
  margin: 4px 0;
}

.tooltip-content code {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

.tooltip-light .tooltip-content code {
  background: rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .tooltip:not(.tooltip-custom-width) {
    max-width: 80vw;
  }

  .tooltip {
    font-size: 13px;
  }

  .tooltip-content {
    padding: 8px 12px;
  }
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
  .tooltip-dark {
    background: rgb(0, 0, 0);
    border: 2px solid rgb(255, 255, 255);
  }

  .tooltip-light {
    background: rgb(255, 255, 255);
    border: 2px solid rgb(0, 0, 0);
  }
}

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

/* Element with tooltip indicator */
[data-tooltip] {
  cursor: help;
  position: relative;
}

/* Optional: Add a subtle underline to indicate tooltips */
[data-tooltip-trigger="hover"]:not(button):not(.btn) {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

/* Ensure tooltips work with buttons */
button[data-tooltip],
.btn[data-tooltip] {
  cursor: pointer;
}
