/* =====================================================
   HERO VIDEO SECTION STYLES
   Based on IYFM implementation
   ===================================================== */

/* --------------------------------------------------
   1. SCROLL LOCK STATES
   -------------------------------------------------- */

/* When video is stopped/paused: Lock scroll */
body.hero-video--stopped {
  overflow: hidden;
  height: 100vh;
}

/* When video is playing: Allow scroll */
body.hero-video--playing {
  overflow: auto;
  height: auto;
}

/* --------------------------------------------------
   2. HERO SECTION BASE STYLES
   -------------------------------------------------- */

.hero-video-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Video container */
.hero-video-section .video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-video-section video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 1;
  transition: opacity 400ms ease;
}

/* --------------------------------------------------
   3. OVERLAY STYLES
   -------------------------------------------------- */

.hero-video-section .video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Adjust darkness */
  z-index: 2;
  transition: opacity 400ms ease;
  pointer-events: none;
}

/* Overlay visible when stopped */
body.hero-video--stopped .hero-video-section .video-overlay {
  opacity: 1;
}

/* Overlay hidden when playing */
body.hero-video--playing .hero-video-section .video-overlay {
  opacity: 0;
}

/* --------------------------------------------------
   4. CONTENT & UI ELEMENTS
   -------------------------------------------------- */

.hero-video-section .hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  opacity: 1;
  transition: opacity 300ms ease;
  pointer-events: auto;
}

/* Hide content when video is playing */
body.hero-video--playing .hero-video-section .hero-content {
  opacity: 0;
  pointer-events: none;
}

/* Show content when video is stopped */
body.hero-video--stopped .hero-video-section .hero-content {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------
   5. HEADER & NAVIGATION
   -------------------------------------------------- */

/* Hide header when playing (adjust selector to match your header) */
body.hero-video--playing .site-header,
body.hero-video--playing header,
body.hero-video--playing nav {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

body.hero-video--stopped .site-header,
body.hero-video--stopped header,
body.hero-video--stopped nav {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 300ms ease;
}

/* --------------------------------------------------
   6. SCROLL INDICATOR
   -------------------------------------------------- */

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  opacity: 1;
  transition: opacity 300ms ease;
  pointer-events: auto;
}

body.hero-video--playing .hero-scroll-indicator {
  opacity: 0;
  pointer-events: none;
}

body.hero-video--stopped .hero-scroll-indicator {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------
   7. PLAY/PAUSE BUTTON
   -------------------------------------------------- */

.hero-play-button {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 300ms ease;
  opacity: 1;
}

.hero-play-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-50%) scale(1.1);
}

/* Hide button when playing */
body.hero-video--playing .hero-play-button {
  opacity: 0;
  pointer-events: none;
}

/* Play/Pause icons */
.hero-play-button .play-icon,
.hero-play-button .pause-icon {
  position: absolute;
  width: 30px;
  height: 30px;
  transition: opacity 200ms ease;
}

.hero-play-button .play-icon {
  opacity: 1;
}

.hero-play-button .pause-icon {
  opacity: 0;
}

body.hero-video--playing .hero-play-button .play-icon {
  opacity: 0;
}

body.hero-video--playing .hero-play-button .pause-icon {
  opacity: 1;
}

/* SVG icon colors */
.hero-play-button svg {
  fill: white;
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------
   8. TYPOGRAPHY IN HERO
   -------------------------------------------------- */

.hero-video-section h1,
.hero-video-section h2,
.hero-video-section p {
  color: white;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-video-section h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-video-section h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 500;
  margin-bottom: 2rem;
}

/* --------------------------------------------------
   9. RESPONSIVE ADJUSTMENTS
   -------------------------------------------------- */

@media (max-width: 768px) {
  .hero-play-button {
    width: 60px;
    height: 60px;
    bottom: 2rem;
  }

  .hero-play-button .play-icon,
  .hero-play-button .pause-icon {
    width: 20px;
    height: 20px;
  }

  .hero-scroll-indicator {
    bottom: 1rem;
  }
}

/* --------------------------------------------------
   10. SMOOTH TRANSITIONS
   -------------------------------------------------- */

* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------
   11. PREVENT SCROLL BEHAVIOR ISSUES
   -------------------------------------------------- */

body.hero-video--stopped {
  /* Prevent any scroll bounce on iOS */
  position: fixed;
  width: 100%;
}

/* --------------------------------------------------
   12. ALTERNATIVE: ELEMENTOR-SPECIFIC CLASSES
      (Use these if your site uses Elementor like IYFM)
   -------------------------------------------------- */

/* If using Elementor background video */
body.hero-video--playing .hero-video-section .elementor-background-video-container {
  opacity: 1;
  pointer-events: auto;
}

body.hero-video--playing .hero-video-section .elementor-background-overlay {
  opacity: 0 !important;
  transition: opacity 400ms ease;
}

body.hero-video--stopped .hero-video-section .elementor-background-overlay {
  opacity: 1 !important;
  transition: opacity 400ms ease;
}

/* Hide Elementor widgets when playing */
body.hero-video--playing .hero-video-section .elementor-widget {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

body.hero-video--stopped .hero-video-section .elementor-widget {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 300ms ease;
}