/* YouTube Video Testimonials Styles */

/* Video testimonial container */
.video-testimonial {
  position: relative;
  overflow: hidden;
}

/* Video wrapper with 16:9 aspect ratio */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}

/* Thumbnail with YouTube thumbnail as background */
.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.video-thumbnail::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
  transition: opacity 0.3s ease;
}

.video-thumbnail:hover {
  transform: scale(1.02);
}

.video-thumbnail:hover::before {
  opacity: 0.5;
}

/* YouTube-style play button */
.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background-color: rgba(255, 0, 0, 0.8);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-play-button:hover {
  background-color: rgba(255, 0, 0, 1);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.video-play-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.video-play-button i {
  margin-left: 4px; /* Optical alignment for play icon */
}

/* Iframe container */
.video-iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.video-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* YouTube icon in author section */
.video-testimonial .testimonial-author .fa-youtube {
  color: #FF0000;
  margin-right: 8px;
  font-size: 1.1em;
}

/* Glass effect for video testimonials */
.video-testimonial.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 1.5rem;
}

.video-testimonial.glass .video-wrapper {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Loading state for video thumbnail */
.video-thumbnail.loading {
  background: linear-gradient(90deg,
    rgba(242, 237, 215, 0.2) 0%,
    rgba(242, 237, 215, 0.4) 50%,
    rgba(242, 237, 215, 0.2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Video testimonial author styling */
.video-testimonial .testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 1rem;
}

/* Fallback for failed video loads */
.video-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--light-text);
  padding: 1rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  z-index: 4;
}

.video-error i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Carousel adjustments for video testimonials */
.testimonial-carousel-slide .video-testimonial {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media screen and (max-width: 768px) {
  .video-play-button {
    width: 60px;
    height: 42px;
    font-size: 1.3rem;
    border-radius: 10px;
  }

  .video-wrapper {
    border-radius: 10px;
  }

  .video-testimonial.glass {
    padding: 1.25rem;
  }

  .video-testimonial .testimonial-author {
    font-size: 0.95rem;
  }
}

@media screen and (max-width: 480px) {
  .video-play-button {
    width: 50px;
    height: 36px;
    font-size: 1.1rem;
    border-radius: 8px;
  }

  .video-wrapper {
    border-radius: 8px;
  }

  .video-testimonial.glass {
    padding: 1rem;
  }

  .video-testimonial .testimonial-author {
    font-size: 0.9rem;
  }

  .video-testimonial .testimonial-author .fa-youtube {
    font-size: 1em;
  }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Focus styles for keyboard navigation */
.video-play-button:focus {
  outline: 3px solid rgba(255, 0, 0, 0.5);
  outline-offset: 4px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .video-thumbnail,
  .video-play-button,
  .video-thumbnail::before {
    transition: none;
    animation: none;
  }

  .video-thumbnail:hover {
    transform: none;
  }

  .video-play-button:hover {
    transform: translate(-50%, -50%);
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .video-play-button {
    background-color: #FF0000;
    border: 2px solid white;
  }

  .video-thumbnail::before {
    background: rgba(0, 0, 0, 0.5);
  }
}

/* Print styles - show text fallback */
@media print {
  .video-wrapper {
    display: none;
  }

  .video-testimonial .testimonial-author::after {
    content: " (Video testimonial)";
    font-style: italic;
    font-size: 0.9em;
    color: #666;
  }
}
