/* Video Modal/Popover Styles */

.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-modal.show {
  display: flex;
  opacity: 1;
}

.video-modal-content {
  position: relative;
  max-height: 90vh;
  background: #FED346;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  align-content: center;
}

.video-modal.show .video-modal-content {
  transform: scale(1);
}

.video-modal video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 80vh;
}

.video-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: none;
  color: #000;
  border: none;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all 0.2s ease;
}

.video-modal-close:hover {
  color: #333;
  transform: scale(1.1);
}

/* Loading spinner for video modal */
.video-modal-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  display: none;
}

.video-modal-loading.show {
  display: block;
}

.video-modal-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Video card modifications for poster-only display */
.video-card-poster,
.video-mobile-card-poster {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
  background: #f8f9fa;
  max-height: 450px;
}

.video-card-poster img,
.video-mobile-card-poster img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.video-card-poster:hover img,
.video-mobile-card-poster:hover img {
  transform: scale(1.05);
}

.video-card-poster .button-play,
.video-mobile-card-poster .button-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.video-card-poster:hover .button-play,
.video-mobile-card-poster:hover .button-play {
  background: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .video-modal-content {
    max-width: 95vw;
    max-height: 85vh;
    width: auto;
    aspect-ratio: 9/16;
    max-width: min(95vw, 80vh * 9/16);
    margin: 20px;
  }

  .video-card-poster .button-play,
  .video-mobile-card-poster .button-play {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .video-modal-content {
    margin: 10px;
    border-radius: 4px;
  }

  .video-modal video {
    max-height: 70vh;
  }
}

/* Accessibility improvements */
.video-modal:focus-within {
  outline: none;
}

.video-modal-content:focus {
  outline: none;
}

/* Animation for backdrop */
.video-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* Prevent body scroll when modal is open */
body.video-modal-open {
  overflow: hidden;
  height: 100vh;
}