/* Tridentu - Lesson Financopedia Tooltips */

.lesson-term-link {
  color: inherit;
  font-weight: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(2, 132, 199, 0.42);
  text-underline-offset: 0.18em;
  cursor: help;
  border-radius: 3px;
  transition:
    color 0.18s ease,
    text-decoration-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.lesson-term-link:hover,
.lesson-term-link:focus-visible,
.lesson-term-link.is-tooltip-active {
  color: var(--primary, #00bfff);
  text-decoration-style: solid;
  text-decoration-color: rgba(0, 191, 255, 0.95);
  background-color: rgba(0, 191, 255, 0.055);
  outline: none;
}

.lesson-term-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.14);
}

.lesson-term-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  width: min(340px, calc(100vw - 28px));
  padding: 14px 15px 15px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 22px 60px rgba(15, 23, 42, 0.16),
    0 8px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #0f172a;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 8px, 0) scale(0.985);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.lesson-term-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
}

.lesson-term-tooltip::before {
  content: "";
  position: absolute;
  left: var(--tooltip-arrow-left, 28px);
  top: -8px;
  width: 15px;
  height: 15px;
  background: rgba(255, 255, 255, 0.97);
  border-left: 1px solid rgba(15, 23, 42, 0.12);
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  transform: rotate(45deg);
}

.lesson-term-tooltip.is-above::before {
  top: auto;
  bottom: -8px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(15, 23, 42, 0.12);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.lesson-term-tooltip__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #0284c7;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-term-tooltip__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #00bfff;
  box-shadow: 0 0 0 4px rgba(0, 191, 255, 0.14);
}

.lesson-term-tooltip__title {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.lesson-term-tooltip__lead {
  margin: 0;
  color: #475569;
  font-size: 13.5px;
  line-height: 1.62;
  font-weight: 500;
}

@media (max-width: 640px) {
  .lesson-term-tooltip {
    width: min(320px, calc(100vw - 20px));
    padding: 13px 14px 14px;
    border-radius: 15px;
  }

  .lesson-term-tooltip__title {
    font-size: 14.5px;
  }

  .lesson-term-tooltip__lead {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-term-link,
  .lesson-term-tooltip {
    transition: none;
  }
}
