/* Movement glossary popup - opened from a movement name on the board / training session.
   See app/static/glossary-popup.js and docs/briefs/brief-movement-glossary-popup.md.
   Tokens only (design-system-lint): colors, spacing, radius from wodpilot.css. */

.glossary-video-icon {
  display: inline-block;
  vertical-align: baseline;
  margin-left: var(--wp-space-2xs, 2px);
  color: var(--color-primary, #1d9e75);
  cursor: pointer;
}

.glossary-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: var(--black-overlay, rgba(0, 0, 0, 0.5));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.glossary-popup-overlay.open {
  opacity: 1;
  visibility: visible;
}

.glossary-popup-lock {
  overflow: hidden;
}

.glossary-popup {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: var(--wp-space-lg, 24px) var(--wp-space-md, 16px) calc(var(--wp-space-lg, 24px) + env(safe-area-inset-bottom, 0px));
  background: var(--color-surface-card, #161921);
  border: var(--border-default, 0.5px solid rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-container, 12px) var(--radius-container, 12px) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

.glossary-popup__close {
  position: absolute;
  top: var(--wp-space-sm, 8px);
  right: var(--wp-space-sm, 8px);
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
  cursor: pointer;
}

.glossary-popup__title {
  margin: 0 var(--wp-space-xl, 32px) var(--wp-space-xs, 4px) 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary, #ffffff);
}

.glossary-popup__cue {
  margin: 0 0 var(--wp-space-md, 16px) 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
}

.glossary-popup__media:empty {
  display: none;
}

.glossary-popup__video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius-element, 8px);
  background: #000;
}

.glossary-popup__demo-link {
  display: inline-block;
  margin-top: var(--wp-space-2xs, 2px);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-primary-light, #5dcaa5);
}

@media (min-width: 641px) {
  .glossary-popup-overlay {
    align-items: center;
    padding: var(--wp-space-md, 16px);
  }

  .glossary-popup {
    width: auto;
    min-width: 360px;
    max-width: 520px;
    border-radius: var(--radius-container, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
}
