/* Widget flotante de videotutorial — z-index bajo modales críticos (2000+) */
.tut-root {
  --tut-z-panel: 1140;
  --tut-z-fab: 1150;
  /* Desplazamiento desde el centro del viewport hasta el centro del FAB (inferior derecha); JS lo pisa con píxeles exactos */
  --tut-minimize-dx: calc(50vw - 54px);
  --tut-minimize-dy: calc(50vh - 54px);
  font-family: "Inter", system-ui, sans-serif;
}

.tut-card {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  /* Ancho máximo 900px; en viewports más estrechos, como mucho el ancho del viewport */
  width: min(900px, 100vw);
  max-height: min(92vh, 640px);
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.12),
    0 20px 56px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.08);
  z-index: var(--tut-z-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transform: translate3d(-50%, -50%, 0) scale(1);
  transform-origin: center center;
  transition:
    opacity 0.35s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.tut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border-bottom: 1px solid #e5e7eb;
}

.tut-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.tut-btn-minimize {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tut-btn-minimize:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.tut-player-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}

.tut-player-wrap #tutorial-yt-player-host {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.tut-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 68px;
  height: 68px;
  z-index: var(--tut-z-fab);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(18, 140, 126, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.65);
  transform-origin: center;
  transition:
    opacity 0.3s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease;
}

.tut-fab:hover {
  box-shadow: 0 8px 26px rgba(18, 140, 126, 0.55);
}

.tut-fab:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 3px;
}

.tut-fab svg {
  width: 42px;
  height: 42px;
}

.tut--expanded .tut-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

.tut--minimized .tut-card {
  opacity: 0;
  pointer-events: none;
  /* Desde el centro del panel hacia el centro del botón de interrogación (FAB) */
  transform: translate3d(
      calc(-50% + var(--tut-minimize-dx)),
      calc(-50% + var(--tut-minimize-dy)),
      0
    )
    scale(0.08);
  box-shadow: none;
}

.tut--minimized .tut-fab {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

@keyframes tutFabPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 6px 20px rgba(18, 140, 126, 0.45);
  }
}

.tut-fab.tut-fab-pulse {
  animation: tutFabPulse 0.65s ease-out 1;
}

.tut-skip-transition .tut-card,
.tut-skip-transition .tut-fab {
  transition: none !important;
}
