/* HTML5 tutorial player — fills the existing video modal like Wistia. */

.modal__content--video:has(.wh-tutorial-player) {
  width: min(960px, 92vw);
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 85vh;
  padding: 0;
  background: #0b0d11;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.wh-tutorial-player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0b0d11;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.wh-tutorial-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
}

.wh-tutorial-player.is-ready video {
  opacity: 1;
}

.wh-tp-cover {
  position: absolute;
  inset: 0;
  background: #0b0d11;
  z-index: 1;
  pointer-events: none;
}

.wh-tutorial-player.is-ready .wh-tp-cover {
  opacity: 0;
}

.wh-tp-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: #e4e8f0;
  text-align: center;
  font-family: Inter, system-ui, sans-serif;
}

.wh-tp-empty strong {
  font-size: 16px;
  font-weight: 600;
}

.wh-tp-empty span {
  font-size: 13px;
  color: #bcc5d4;
}

.wh-tp-big-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.2s ease;
  z-index: 3;
}

.wh-tp-big-play:hover {
  transform: scale(1.06);
  background: rgba(34, 90, 234, 0.92);
}

.wh-tp-big-play svg {
  width: 32px;
  height: 32px;
  margin-left: 3px;
}

.wh-tutorial-player.is-playing .wh-tp-big-play,
.wh-tutorial-player.is-empty .wh-tp-big-play,
.wh-tutorial-player.is-empty .wh-tp-controls {
  opacity: 0;
  pointer-events: none;
}

.wh-tp-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wh-tp-spin 0.7s linear infinite;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.wh-tutorial-player.is-waiting .wh-tp-spinner {
  opacity: 1;
}

@keyframes wh-tp-spin {
  to { transform: rotate(360deg); }
}

.wh-tp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 70%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 4;
}

.wh-tutorial-player:hover .wh-tp-controls,
.wh-tutorial-player.is-paused .wh-tp-controls,
.wh-tutorial-player.is-scrubbing .wh-tp-controls {
  opacity: 1;
  transform: translateY(0);
}

.wh-tp-progress {
  position: relative;
  height: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.wh-tp-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.wh-tp-progress:hover .wh-tp-progress-track {
  height: 6px;
}

.wh-tp-buffer,
.wh-tp-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
}

.wh-tp-buffer {
  background: rgba(255, 255, 255, 0.38);
}

.wh-tp-played {
  background: #225aea;
}

.wh-tp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.wh-tp-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.wh-tp-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.wh-tp-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.wh-tp-time {
  min-width: 92px;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.88);
}

.wh-tp-spacer {
  flex: 1;
}

.wh-tp-volume {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wh-tp-volume input[type="range"] {
  width: 0;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.15s ease;
  accent-color: #225aea;
}

.wh-tp-volume:hover input[type="range"],
.wh-tp-volume:focus-within input[type="range"] {
  width: 72px;
  opacity: 1;
}

.wh-tp-speed {
  position: relative;
}

.wh-tp-speed-menu {
  position: absolute;
  right: 0;
  bottom: 40px;
  min-width: 84px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: none;
}

.wh-tp-speed.is-open .wh-tp-speed-menu {
  display: block;
}

.wh-tp-speed-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.wh-tp-speed-menu button.is-active,
.wh-tp-speed-menu button:hover {
  background: rgba(34, 90, 234, 0.85);
}

.wh-tp-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wh-tp-close:hover {
  background: rgba(15, 23, 42, 0.88);
}

.wh-tp-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 640px) {
  .modal__content--video:has(.wh-tutorial-player) {
    width: 94vw;
    border-radius: 10px;
  }

  .wh-tp-volume input[type="range"] {
    display: none;
  }

  .wh-tp-time {
    min-width: 0;
  }
}
