/**
 * Testimonial Widget Styles
 *
 * Video preview (poster + play button), inline player, and lightbox modal.
 *
 * IMPORTANT:
 * - Uses ONLY CSS variables (NO hardcoded values)
 * - Responsive: Desktop (>=992px), Tablet (768-991px), Mobile (<=767px)
 *
 * @package Elementor_WB
 */

/* ============================================================================
   VIDEO PREVIEW (poster image + play button overlay)
   ========================================================================= */

.wb-video-preview {
  position: relative;
  display: block;
  cursor: pointer;
  overflow: hidden;
  border-radius: inherit;
}

.wb-video-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.wb-video-preview:hover img {
  transform: scale(1.03);
}

/* Fallback when no poster image is set: show a dark placeholder */
.wb-video-preview--no-poster {
  aspect-ratio: 1 / 1;
  background: #1a1a1a;
}

/* ============================================================================
   PLAY BUTTON
   ========================================================================= */

.wb-video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.wb-video-preview:hover .wb-video-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
}

.wb-video-play-btn svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* ============================================================================
   INLINE VIDEO PLAYER (replaces poster in the same container)
   ========================================================================= */

.wb-video-inline {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: inherit;
  overflow: hidden;
  background: #000;
}

.wb-video-inline iframe,
.wb-video-inline video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Hidden state for preview when inline video is playing */
.wb-video-preview--hidden {
  display: none;
}

/* ============================================================================
   LIGHTBOX / MODAL
   ========================================================================= */

.wb-video-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wb-video-lightbox--active {
  opacity: 1;
  visibility: visible;
}

.wb-video-lightbox__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.wb-video-lightbox__container {
  position: relative;
  width: 90vw;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  z-index: 2;
  border-radius: var(--_ui-styles---radius--medium, 8px);
  overflow: hidden;
  background: #000;
}

.wb-video-lightbox__container iframe,
.wb-video-lightbox__container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.wb-video-lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: #fff;
  padding: 0;
  transition: opacity 0.2s ease;
}

.wb-video-lightbox__close:hover {
  opacity: 0.7;
}

.wb-video-lightbox__close svg {
  width: 24px;
  height: 24px;
}

/* ============================================================================
   RESPONSIVE — Tablet (<=991px)
   ========================================================================= */

@media screen and (max-width: 991px) {
  .wb-video-play-btn svg {
    width: 64px;
    height: 64px;
  }

  .wb-video-lightbox__container {
    width: 92vw;
  }

  .wb-video-lightbox__close {
    top: -36px;
  }
}

/* ============================================================================
   RESPONSIVE — Mobile (<=767px)
   ========================================================================= */

@media screen and (max-width: 767px) {
  .wb-video-play-btn svg {
    width: 56px;
    height: 56px;
  }

  .wb-video-lightbox__container {
    width: 95vw;
  }

  .wb-video-lightbox__close {
    top: -32px;
    width: 28px;
    height: 28px;
  }

  .wb-video-lightbox__close svg {
    width: 20px;
    height: 20px;
  }
}
