/**
 * Video Styles
 *
 * @package Wootimize_Review
 * @since 2.0.0
 */

/* Video Item Container */
.wootimize-video-item {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

/* Uploaded Video Player */
.wootimize-video-upload .video-wrapper {
  position: relative;
  width: 100%;
}

.wootimize-video-player {
  width: 100%;
  height: auto;
  display: block;
  max-height: 400px;
  object-fit: contain;
  background: #000;
}

/* Video Embed (YouTube/Vimeo) */
.wootimize-video-embed {
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.wootimize-video-embed .video-thumbnail-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.wootimize-video-embed .video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wootimize-video-embed .video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.wootimize-video-embed:hover .video-play-button {
  background: rgba(255, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

.wootimize-video-embed .play-icon {
  color: #fff;
  font-size: 24px;
  margin-left: 4px;
}

/* Video Source Badges */
.video-source-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.youtube-badge {
  background: #ff0000;
  color: #fff;
}

.vimeo-badge {
  background: #1ab7ea;
  color: #fff;
}

/* Video Embed Active State (iframe loaded) */
.wootimize-video-embed.is-playing .video-thumbnail-wrapper {
  display: none;
}

.wootimize-video-embed .video-iframe-wrapper {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.wootimize-video-embed.is-playing .video-iframe-wrapper {
  display: block;
}

.wootimize-video-embed .video-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Video in Review Media Grid */
.review-media-grid .wootimize-video-item {
  aspect-ratio: 1;
}

.review-media-grid .wootimize-video-item .video-play-button {
  width: 48px;
  height: 34px;
  border-radius: 8px;
}

.review-media-grid .wootimize-video-item .play-icon {
  font-size: 18px;
}

/* Video in Customer Media Gallery */
.wootimize-customer-images__grid .wootimize-video-item {
  aspect-ratio: 1;
}

.wootimize-customer-images__grid .wootimize-video-embed .video-thumbnail {
  object-fit: cover;
}

/* Video Lightbox */
.wootimize-review-lightbox .wootimize-video-player {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 8px;
}

.wootimize-review-lightbox .video-iframe-wrapper {
  width: 90vw;
  max-width: 960px;
  aspect-ratio: 16 / 9;
}

.wootimize-review-lightbox .video-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* Video URL Input in Review Form */
.wootimize-video-url-input {
  margin-top: 12px;
}

.wootimize-video-url-input label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}

.wootimize-video-url-input input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.wootimize-video-url-input input:focus {
  outline: none;
  border-color: #1e1e1e;
  box-shadow: 0 0 0 2px rgba(30, 30, 30, 0.1);
}

.wootimize-video-url-input .url-hint {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

/* Video Preview in Upload List */
.wootimize-review-upload__list .video-preview {
  position: relative;
  width: 100%;
  height: 70px;
  background: #1e1e1e;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wootimize-review-upload__list .video-preview .video-icon {
  color: #fff;
  font-size: 24px;
}

.wootimize-review-upload__list .video-preview .video-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
}

/* Review Video Autoplay Styles */
.wootimize-review-video video,
.wootimize-review-media video {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  cursor: pointer;
}

/* Video container in review media */
.wootimize-review-video,
.wootimize-review-media .media-item--video {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 300px;
}

/* Play indicator overlay */
.wootimize-review-video::before,
.wootimize-review-media .media-item--video::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Sound indicator */
.wootimize-review-video::after,
.wootimize-review-media .media-item--video::after {
  content: '\1F507'; /* Muted speaker emoji */
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wootimize-review-video:hover::after,
.wootimize-review-media .media-item--video:hover::after {
  opacity: 1;
}

/* Responsive Video Styles */
@media (max-width: 768px) {
  .wootimize-video-player {
    max-height: 280px;
  }

  .wootimize-video-embed .video-play-button {
    width: 56px;
    height: 40px;
  }

  .wootimize-video-embed .play-icon {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .wootimize-video-player {
    max-height: 200px;
  }

  .wootimize-video-embed .video-play-button {
    width: 48px;
    height: 34px;
  }

  .wootimize-video-embed .play-icon {
    font-size: 16px;
  }
}
