/**
 * Glossary Tooltip Styles
 * Interactive hover definitions for IoT terminology
 */

/* Glossary term styling - underline indicates clickable/hoverable */
.glossary-term {
  border-bottom: 1px dotted #16A085;
  cursor: help;
  color: inherit;
  transition: border-color 0.2s ease;
}

.glossary-term:hover,
.glossary-term:focus {
  border-bottom-color: #E67E22;
  outline: none;
}

/* Tooltip container */
.glossary-tooltip {
  position: absolute;
  z-index: 1000;
  max-width: 320px;
  padding: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #E5E5E5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.glossary-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Tooltip header */
.glossary-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
  border-radius: 8px 8px 0 0;
}

.glossary-tooltip-term {
  font-weight: bold;
  color: white;
  font-size: 14px;
}

.glossary-tooltip-link {
  font-size: 11px;
  color: #85C1E9;
  text-decoration: none;
  transition: color 0.2s ease;
}

.glossary-tooltip-link:hover {
  color: white;
  text-decoration: underline;
}

/* Tooltip content */
.glossary-tooltip-definition {
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #2C3E50;
  border-bottom: 1px solid #E5E5E5;
}

.glossary-tooltip-simple {
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #666;
  background: #F8F9FA;
  border-radius: 0 0 8px 8px;
}

.glossary-tooltip-simple::before {
  content: "In simple terms: ";
  font-weight: 600;
  color: #16A085;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .glossary-term {
    border-bottom-color: #1ABC9C;
  }

  .glossary-tooltip {
    background: #2C3E50;
    border-color: #34495E;
  }

  .glossary-tooltip-header {
    background: linear-gradient(135deg, #1B2631 0%, #2C3E50 100%);
  }

  .glossary-tooltip-definition {
    color: #ECF0F1;
    border-bottom-color: #34495E;
  }

  .glossary-tooltip-simple {
    background: #1B2631;
    color: #BDC3C7;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .glossary-tooltip {
    max-width: 280px;
    left: 10px !important;
    right: 10px;
  }
}

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

  .glossary-term {
    border-bottom: none;
  }
}
