/* Service Video Container - Responsive and Modern */
.service-video-container {
  position: relative;
  width: 100%;
  max-width: 900px; /* Larger maximum width for better visibility */
  margin: 0 auto; /* Center the container */
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  background-color: #000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-video-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15),
    0 15px 15px -5px rgba(0, 0, 0, 0.06);
}

.service-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 16px;
}

/* Loading state */
.service-video-container::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #0059b3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

.service-video-container.loaded::before {
  display: none;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive sizing */
@media (max-width: 768px) {
  .service-video-container {
    max-width: 100%;
    border-radius: 12px;
    margin: 0 auto; /* Center on mobile, no negative margins */
  }

  .service-video-container iframe {
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .service-video-container {
    border-radius: 8px;
  }

  .service-video-container iframe {
    border-radius: 8px;
  }
}

/* Tablet sizing */
@media (min-width: 769px) and (max-width: 1024px) {
  .service-video-container {
    max-width: 700px;
  }
}

/* Large desktop sizing */
@media (min-width: 1025px) {
  .service-video-container {
    max-width: 900px;
  }
}

/* Extra large screens */
@media (min-width: 1440px) {
  .service-video-container {
    max-width: 1000px;
  }
}

/* Focus accessibility */
.service-video-container:focus-within {
  outline: 3px solid #0059b3;
  outline-offset: 4px;
}

/* Print styles */
@media print {
  .service-video-container {
    display: none;
  }
}

/* Legacy video container styles (for backwards compatibility) */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* YouTube Video Facade Styles */
.video-facade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease;
  z-index: 2;
}

.video-facade:hover {
  transform: scale(1.01);
}

.video-facade-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.video-facade:hover .video-facade-thumbnail {
  opacity: 0.85;
}

.video-facade-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 0, 0, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.video-facade:hover .video-facade-play {
  background: #ff0000;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.video-facade-play::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 22px solid white;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  margin-left: 6px;
}

.video-facade-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 30px 20px 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-facade:hover .video-facade-info {
  opacity: 1;
}

.video-facade-title {
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
  font-size: 16px;
}

.video-facade-duration {
  font-size: 13px;
  opacity: 0.9;
}

/* Loading state for facade */
.video-facade.loading {
  pointer-events: none;
}

.video-facade.loading .video-facade-play {
  background: rgba(255, 255, 255, 0.3);
  animation: facade-pulse 1.5s ease-in-out infinite;
}

@keyframes facade-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Hide facade when iframe is loaded */
.service-video-container.iframe-loaded .video-facade {
  display: none;
}

/* Responsive facade adjustments */
@media (max-width: 768px) {
  .video-facade {
    border-radius: 12px;
  }

  .video-facade-play {
    width: 70px;
    height: 70px;
  }

  .video-facade-play::before {
    border-left: 18px solid white;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    margin-left: 4px;
  }

  .video-facade-info {
    padding: 20px 16px 16px;
  }

  .video-facade-title {
    font-size: 14px;
  }

  .video-facade-duration {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .video-facade {
    border-radius: 8px;
  }

  .video-facade-play {
    width: 60px;
    height: 60px;
  }

  .video-facade-play::before {
    border-left: 16px solid white;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    margin-left: 3px;
  }
}
