/**
 * Video Hotspot Styles for Marzipano Tours
 * Glass morphism theme with perspective-safe styling
 */

.video-hotspot {
  cursor: pointer;
  position: relative;
  /* Preserve 3D for Marzipano perspective transforms */
  transform-style: preserve-3d;
}

.video-hotspot-container {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  /* REMOVED: transform scale on hover - conflicts with perspective */
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.video-hotspot-container:hover {
  /* Use shadow/border instead of transform to avoid jumping */
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(100, 150, 255, 0.5);
  border-color: rgba(100, 150, 255, 0.6);
}

/* Video/iframe fills container */
.video-hotspot-container video,
.video-hotspot-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  /* Prevent video controls from interfering */
  pointer-events: auto;
}

/* Optional title overlay */
.video-hotspot-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.4),
    transparent
  );
  color: white;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
  border-radius: 0 0 12px 12px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .video-hotspot-container {
    max-width: 90vw;
  }
  
  .video-hotspot-title {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Loading state (optional) */
.video-hotspot-container.loading {
  background: rgba(0, 0, 0, 0.5);
}

.video-hotspot-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Play button overlay (for non-autoplay videos) */
.video-hotspot-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* Use opacity instead of scale to avoid transform conflicts */
  transition: opacity 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.video-hotspot-play-button:hover {
  opacity: 1;
  background: white;
}

.video-hotspot-play-button::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 25px solid #000;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  margin-left: 5px;
}

/* Hide play button when video is playing */
.video-hotspot-container.playing .video-hotspot-play-button {
  display: none;
}
