/* Glossary term styling */
.glossary-term {
  text-decoration: underline dotted;
  text-decoration-color: rgba(0, 100, 200, 0.8);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: help;
  transition: text-decoration-color 0.2s ease;
}

.glossary-term:hover {
  text-decoration-color: rgba(0, 100, 200, 1);
  text-decoration-thickness: 2.5px;
}

.glossary-term:focus {
  outline: 2px solid rgba(0, 100, 200, 0.5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Tooltip styling */
.glossary-tooltip {
  position: absolute;
  z-index: 10000;
  background: #2c3e50;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 300px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.glossary-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 20px;
  border: 6px solid transparent;
  border-bottom-color: #2c3e50;
}

.glossary-tooltip em {
  color: #95a5a6;
  font-style: italic;
}

/* Modal styling */
.glossary-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.glossary-modal.active {
  display: block;
}

.glossary-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.glossary-modal-dialog {
  position: relative;
  margin: 50px auto;
  max-width: 600px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glossary-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.glossary-modal-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  text-transform: capitalize;
}

.glossary-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #95a5a6;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.glossary-modal-close:hover {
  background: #ecf0f1;
  color: #2c3e50;
}

.glossary-modal-body {
  padding: 20px;
}

.glossary-modal-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #34495e;
}

.glossary-modal-content p {
  margin: 0 0 15px 0;
}

.glossary-modal-content p:last-child {
  margin-bottom: 0;
}

.glossary-attribution {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  color: #7f8c8d;
}

.glossary-attribution a {
  color: #3498db;
  text-decoration: none;
}

.glossary-attribution a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .glossary-modal-dialog {
    margin: 20px;
    max-width: calc(100% - 40px);
  }

  .glossary-tooltip {
    max-width: 250px;
    font-size: 0.85rem;
  }
}
