/* Efecto Teatro de Video - Video expandido con blur alrededor */

/* Overlay principal del teatro */
.video-theater-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(16, 17, 26, 0.95); /* Color de fondo coherente con el tema */
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-theater-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Contenedor del video expandido */
.video-theater-container {
  position: relative;
  width: 90vw;
  max-width: 1280px;
  aspect-ratio: 16/9; /* Proporción 16:9 para mejor visualización */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(191, 0, 255, 0.3), /* Púrpura principal */
    0 0 50px rgba(191, 0, 255, 0.2);
  transform: scale(0.8) translateY(50px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-theater-overlay.active .video-theater-container {
  transform: scale(1) translateY(0);
}

/* Video iframe expandido */
.video-theater-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* Botón de cerrar mejorado */
.video-theater-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 45px;
  height: 45px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(191, 0, 255, 0.8);
  border-radius: 50%;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 1002;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-theater-close:hover {
  background: rgba(191, 0, 255, 0.9);
  border-color: rgba(191, 0, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(191, 0, 255, 0.6);
}

/* Desactivar hover effects cuando el video está reproduciéndose */
.video-theater-active .video-theater-close:hover {
  background: rgba(191, 0, 255, 0.9);
  border-color: rgba(191, 0, 255, 1);
  transform: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: none;
}

.video-theater-close:active {
  transform: scale(0.95);
}

/* Efectos de blur en el fondo */
.video-theater-blur-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(191, 0, 255, 0.08) 0%, transparent 50%), /* Púrpura principal */
    radial-gradient(circle at 70% 70%, rgba(138, 43, 226, 0.06) 0%, transparent 50%), /* Púrpura secundario */
    radial-gradient(circle at 50% 50%, rgba(255, 51, 153, 0.04) 0%, transparent 70%); /* Rosa de marca */
  filter: blur(100px);
  opacity: 0.6;
  animation: theater-bg-pulse 4s ease-in-out infinite;
}

@keyframes theater-bg-pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Indicador de carga */
.video-theater-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #4808AA; /* Púrpura principal */
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-theater-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(72, 8, 170, 0.3);
  border-top: 2px solid #4808AA;
  border-radius: 50%;
  animation: theater-spin 1s linear infinite;
}

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

/* Información del video */
.video-theater-info {
  position: absolute;
  bottom: -60px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  opacity: 0.8;
  /* Ocultar por defecto para evitar interferencia con videos */
  display: none;
}

.video-theater-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #4808AA; /* Púrpura principal */
}

.video-theater-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

/* Efectos responsive */
@media (max-width: 768px) {
  .video-theater-container {
    width: 95vw;
    max-width: 95vw;
    aspect-ratio: 16/9; /* Mantener proporción 16:9 en móviles */
    margin: 20px auto;
  }
  
  .video-theater-close {
    top: -45px;
    right: 0;
    width: 40px;
    height: 40px;
    font-size: 20px;
    /* Mejorar área táctil */
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
  }
  
  .video-theater-info {
    bottom: -60px;
    padding: 16px;
    background: rgba(16, 17, 26, 0.95);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    /* Mantener oculto en responsive también */
    display: none !important;
  }
  
  .video-theater-title {
    font-size: 18px;
    margin-bottom: 8px;
  }
  
  .video-theater-description {
    font-size: 14px;
    line-height: 1.5;
  }
}

@media (max-width: 480px) {
  .video-theater-overlay {
    padding: 20px 10px;
  }
  
  .video-theater-container {
    width: 98vw;
    max-width: 98vw;
    aspect-ratio: 16/9; /* Mantener proporción 16:9 en pantallas pequeñas */
    margin: 10px auto;
  }
  
  .video-theater-close {
    top: -50px;
    right: 5px;
    width: 44px;
    height: 44px;
    font-size: 22px;
    /* Área táctil optimizada para móvil */
    min-width: 48px;
    min-height: 48px;
    border-width: 2px;
  }
  
  .video-theater-info {
    bottom: -80px;
    left: 5px;
    right: 5px;
    padding: 20px;
    text-align: center;
    /* Mantener oculto en mobile también */
    display: none !important;
  }
  
  .video-theater-title {
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
  }
  
  .video-theater-description {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
  }
  
  /* Mejorar loading en móvil */
  .video-theater-loading {
    font-size: 16px;
  }
  
  .video-theater-loading .spinner {
    width: 40px;
    height: 40px;
  }
}

/* Animación de entrada */
@keyframes theater-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Prevenir scroll del body cuando está activo */
body.video-theater-active {
  overflow: hidden;
}

/* Efecto de glow en el contenedor */
.video-theater-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    rgba(191, 0, 255, 0.4), /* Púrpura principal */
    rgba(138, 43, 226, 0.3), /* Púrpura secundario */
    rgba(255, 51, 153, 0.2), /* Rosa de marca */
    rgba(191, 0, 255, 0.4)
  );
  border-radius: 14px;
  z-index: -1;
  animation: theater-glow-pulse 3s ease-in-out infinite;
}

@keyframes theater-glow-pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

/* Transición suave para el iframe */
.video-theater-iframe {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.video-theater-iframe.loaded {
  opacity: 1;
}