/* Overlay styles */
.video-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.video-overlay.active {
  display: flex;
}

/* Video container */
.video-container {
  position: relative;
  width: 90vw;
  max-width: 1600px;
  aspect-ratio: 16 / 9 !important;
  background-color: #000;
  transform: scale(0.7);
  transition: transform 0.3s ease;
  z-index: 10001;
}

/* Ensure video container stays within overlay */
.video-overlay.active .video-container {
  transform: scale(1);
}

/* Embedded YouTube iframe */
.video-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
  display: block;
  aspect-ratio: 16 / 9 !important;
}

/* Close button */
.video-overlay .close-btn {
  position: absolute;
  top: 10px; /* Adjusted for new parent */
  right: 20px;
  color: #fff !important;
  font-size: 40px;
  font-family: Arial, sans-serif, 'Segoe UI Symbol';
  cursor: pointer;
  background: rgba(0, 0, 0, 0.8) !important;
  border: 2px solid #ff0000 !important; /* Debug border */
  padding: 10px;
  border-radius: 8px;
  z-index: 10002 !important;
  transition: background 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
  line-height: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  visibility: visible !important;
}

.video-overlay .close-btn:hover {
  background: rgba(255, 0, 0, 0.8) !important;
  transform: scale(1.1);
}

.video-overlay .close-btn:focus {
  outline: 3px solid #ff0000;
  outline-offset: 2px;
}

/* SVG close icon */
.video-overlay .close-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2;
}

/* Unmute hint */
.video-overlay .unmute-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.85);
  padding: 12px 20px;
  border-radius: 5px;
  z-index: 10003;
  font-size: 18px;
  text-align: center;
}

/* Desktop optimization */
@media (min-width: 768px) {
  .video-container {
    width: 85vw;
    max-width: 1600px;
  }
  .video-overlay .close-btn {
    top: 20px;
    font-size: 30px;
    padding: 10px;
  }
  .video-overlay .unmute-hint {
    font-size: 20px;
    padding: 15px 25px;
  }
}

/* Mobile optimization */
@media (max-width: 767px) {
  .video-container {
    width: 95vw;
    max-width: none;
  }
  .video-overlay .close-btn {
    top: 10px;
	right:10px;
    font-size: 32px;
    padding: 10px;
  }
  .video-overlay .unmute-hint {
    font-size: 14px;
    padding: 10px 15px;
  }
}