/* =========================================================================
   Showcase Video Components — used across homepage video placements
   ========================================================================= */

/* --- Demo video inside the browser mockup (Placement 1) --- */
.sp-browser-body .sp-demo-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: hsl(240, 10%, 5%);
}

/* Play/pause control overlay on the browser-body video */
.sp-video-control {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 15;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid hsla(190, 100%, 50%, 0.3);
  background: hsla(240, 10%, 8%, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.2s ease;
  transform: scale(0.9);
}

.sp-browser-body:hover .sp-video-control,
.sp-video-control:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.sp-video-control:hover {
  background: hsla(190, 100%, 50%, 0.2);
  border-color: var(--sp-primary);
}

.sp-video-control:focus-visible {
  outline: 2px solid var(--sp-primary);
  outline-offset: 2px;
}

/* --- Promo video card (Placements 2 & 3 — user-initiated playback) --- */
.sp-video-card,
.sp-video-card-compact {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: hsl(240, 10%, 5%);
  border: 1px solid var(--sp-border);
  box-shadow:
    0 0 0 1px hsla(190, 100%, 50%, 0.06),
    0 20px 60px -12px hsla(0, 0%, 0%, 0.4);
}

.sp-video-card-compact {
  border-radius: 0.75rem;
}

.sp-promo-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: hsl(240, 10%, 5%);
  cursor: pointer;
}

/* Large play button overlay for user-initiated videos */
.sp-video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 2px solid hsla(0, 0%, 100%, 0.5);
  background: hsla(240, 10%, 8%, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 24px hsla(0, 0%, 0%, 0.3);
}

.sp-video-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: hsla(190, 100%, 50%, 0.25);
  border-color: var(--sp-primary);
}

.sp-video-play-btn:focus-visible {
  outline: 2px solid var(--sp-primary);
  outline-offset: 3px;
}

/* Hide play button once video is playing */
.sp-video-card.playing .sp-video-play-btn,
.sp-video-card-compact.playing .sp-video-play-btn {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Show play button on hover over the card when paused */
.sp-video-card:not(.playing):hover .sp-video-play-btn,
.sp-video-card-compact:not(.playing):hover .sp-video-play-btn {
  transform: translate(-50%, -50%) scale(1.05);
}

.sp-play-icon-large {
  line-height: 1;
  margin-left: 0.2em; /* optical centering for ▶ */
}

/* --- Reduced motion: prevent auto-play and suppress animations --- */
@media (prefers-reduced-motion: reduce) {
  .sp-demo-video[data-autoplay-enabled] {
    animation: none !important;
    transition: none !important;
  }

  .sp-video-control {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Mobile responsiveness --- */
@media (max-width: 767px) {
  .sp-video-play-btn {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.25rem;
  }

  .sp-video-control {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.75rem;
    opacity: 1; /* always visible on touch devices */
    transform: scale(1);
  }
}

/* =========================================================================
   Hero Background Video
   ========================================================================= */
.sp-hero-video-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.sp-hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: hsl(240, 10%, 5%);
}

/* Dark overlay for brand readability */
.sp-hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    hsla(240, 15%, 5%, 0.85) 0%,
    hsla(240, 10%, 8%, 0.65) 50%,
    hsla(240, 15%, 5%, 0.85) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* When motion is reduced: hide video, show poster only */
@media (prefers-reduced-motion: reduce) {
  .sp-hero-bg-video {
    display: none;
  }

  .sp-hero-video-overlay {
    background: hsl(240, 15%, 5%);
  }
}

/* =========================================================================
   Pricing Video — Landscape 16:9 for "Why Go Pro?" on all viewports
   ========================================================================= */
.sp-video-pricing-wrapper {
  width: 100%;
}

.sp-promo-video-pricing {
  aspect-ratio: 16 / 9;
}

/* Mobile: keep 16:9 landscape layout — portrait source removed */

/* =========================================================================
   Embedded Video (YouTube/Vimeo) — responsive sizing for iframe fallback
   ========================================================================= */
.sp-video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}
.sp-video-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* Hero background — iframe embed fills the container like the video does */
.sp-hero-video-container .sp-video-embed {
  position: absolute;
  inset: 0;
  aspect-ratio: unset;
  width: 100%;
  height: 100%;
}
.sp-hero-video-container .sp-video-embed iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
