/* HTML5 Video Background Styles */

#video-background {
  position: fixed;
  top: -50px;
  left: -50px;
  width: calc(100% + 100px);  /* Add extra width */
  height: calc(100% + 100px); /* Add extra height */
  overflow: hidden;
  z-index: -1; /* Place it behind all content */
  pointer-events: none; /* Allow clicking through the background */
  visibility: visible; /* Ensure visibility */
  opacity: 1;
  transition: opacity 0.5s ease;
}

#video-background-player {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  /* Improved transform with larger scale for better coverage */
  transform: translateX(-50%) translateY(-50%) scale(1.2);
  opacity: 1;
  pointer-events: none !important; /* Prevent interactions */
  object-fit: cover; /* Ensure the video covers the container */
  /* Add this to make sure the video always fills the container */
  object-position: center center;
}

/* Additional mobile-specific adjustments */
@media (max-width: 767px) {
  #video-background-player {
    min-width: 200%; /* Larger min-width for mobile */
    min-height: 200%; /* Larger min-height for mobile */
    transform: translateX(-50%) translateY(-50%) scale(1.3); /* Scale up more on mobile */
  }
}

/* Make sure iframe has no border */
#video-background-player iframe {
  border: 0 !important;
  pointer-events: none !important;
}

/* Add this after the iframe is created to ensure controls are hidden */
#video-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10; /* Above the iframe */
  pointer-events: none;
}

/* Overlay to darken and blur the video */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7); /* Default value, will be updated by JS */
  backdrop-filter: blur(8px); /* Default value, will be updated by JS */
  -webkit-backdrop-filter: blur(8px); /* For Safari */
  pointer-events: none; /* Allow clicking through */
  z-index: 5; /* Above video, below other content */
  transition: background-color 0.5s ease, backdrop-filter 0.5s ease, -webkit-backdrop-filter 0.5s ease;
}

/* For browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(8px)) {
  .video-overlay {
    background: rgba(0, 0, 0, 0.85); /* Darker overlay for browsers without blur support */
  }
}
