/**
 * Modern YouTube Video Lightbox Modal
 * Architecture: BEM & Mobile-first CSS (Hardware Accelerated 60fps)
 */

/* Lock Scroll on body when active */
body.yt-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Backdrop Overlay */
.yt-modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, visibility;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.25s ease;
}

.yt-modal-overlay.yt-modal-active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Modal Content Wrapper */
.yt-modal-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  transform: scale(0.96) translate3d(0, 10px, 0);
  opacity: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease;
}

.yt-modal-overlay.yt-modal-active .yt-modal-wrapper {
  transform: scale(1) translate3d(0, 0, 0);
  opacity: 1;
}

/* Close Button */
.yt-modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
  outline: none;
  z-index: 10;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.yt-modal-close:hover,
.yt-modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
  color: #ffffff;
}

/* Responsive 16:9 Aspect Ratio Video Frame */
.yt-modal-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  background-color: #000000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
}

.yt-modal-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
}

@media (max-width: 768px) {
  .yt-modal-overlay {
    padding: 12px;
  }
  .yt-modal-close {
    top: -40px;
    right: 5px;
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
  .yt-modal-video-container {
    border-radius: 10px;
  }
}
