.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.video-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 90vw;       /* almost full width */
  height: calc(90vw * 9 / 16); /* maintain 16:9 ratio based on width */
  max-width: 1200px;
  max-height: 675px; /* 16:9 ratio relative to max-width */
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .video-modal-content {
    width: 95vw;
    height: calc(95vw * 9 / 16); /* 16:9 ratio for smaller screens */
  }
}

.video-modal-content iframe {
  width: 100%;
  height: 100%;
}


.video-modal-close {
  position: fixed; /* Always top-right */
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
}

/* Active class triggers fade + scale */
.video-modal.active .video-modal-overlay {
  opacity: 1;
}

.video-modal.active .video-modal-content {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}