/* Pop-up/Lightbox */
.video-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.coming_soon_youtube_message {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.coming_soon_youtube_message p {
  color: #fff;
  text-align: center;
  margin: 0;
}

.video-popup-content {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.video-wrapper {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16/9;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.video-wrapper #player {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto;
}

.close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.video-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 2;
  background: rgba(0,0,0,0.6);
  border-radius: 3px;
  padding: 8px 12px;
}

.video-controls button {
  background: transparent;
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 16px;
  font-family: sans-serif;
  border-radius: 3px;
  cursor: button;
  min-width: max-content;
}

.video-controls button:hover {
  background: rgba(255,255,255,0.1);
}

.caption {
  position: absolute;
  left: 20px;
  bottom: 20px;
  background: rgba(0,0,0,0.6);
  padding: 8px 16px;
  font-size: 16px;
  font-family: sans-serif;
  color: #fff;
  border-radius: 3px;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.video-controls, .caption {
  transition: opacity 0.3s ease-out;
}

.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

/* Mobile styles */
@media (max-width: 600px) {
  .video-popup-content {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center everything vertically */
    align-items: center;
    background: #000;
    overflow-y: auto;
  }

  .video-wrapper {
    width: 100%;
    max-width: 100vw;
    height: auto;
    aspect-ratio: 16/9;
    max-height: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #000;
    margin: 0 auto;
  }

  #player {
    pointer-events: auto;
  }

  .video-wrapper #player {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border: none;
    pointer-events: auto;
  }

  .video-controls {
    position: static;
    display: flex;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    margin: 20% auto 0;
    background: rgba(0,0,0,0.6);
    border-radius: 3px;
    padding: 6px 8px;
    bottom: auto;
    right: auto;
  }

  .caption {
    position: static;
    display: block;
    width: fit-content;
    margin: 10px auto 0;
    background: rgba(0,0,0,0.6);
    border-radius: 3px;
    left: auto;
    bottom: auto;
    padding: 6px 10px;
    font-size: 13px;
  }

  .close-button {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
}


/* Mobile landscape styles (screen width > height and max-width: 1000px, adjust as needed) */
@media (max-width: 1000px) and (orientation: landscape) {
  .video-controls {
    position: fixed; /* or absolute if .video-popup is position:fixed */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    height: fit-content;
    background: rgba(0,0,0,0.6);
    border-radius: 3px;
    padding: 8px 12px;
    margin: 0;
    z-index: 2;
  }
  .video-wrapper #player {
    transform: scale(1.2);
}
  element.style {
    width: 100%;
    height: auto;
}
}