/* Pantalla de video */
.video-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Mantener aspect ratio 16:9 */
.video-container {
  aspect-ratio: 16/9;
  width: min(90vw, calc(80vh * 16/9));
  height: min(80vh, calc(90vw * 9/16));
}

.main-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Controles de video mejorados */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 20px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Layout de controles */
.controls-left,
.controls-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.controls-right {
  justify-content: flex-end;
}

.controls-center {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Tiempo */
.time-display {
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  min-width: 120px;
}

/* Botones de control */
.control-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  position: relative;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.control-btn:active {
  transform: scale(0.95);
}

/* Botón reinicio */
.restart-btn {
  width: 45px;
  height: 45px;
}

.restart-btn:hover {
  background: rgba(52, 152, 219, 0.3);
  border-color: rgba(52, 152, 219, 0.6);
}

/* Botón play/pause (principal) */
.play-pause-btn {
  width: 60px;
  height: 60px;
  font-size: 20px;
  border-width: 3px;
}

.play-pause-btn:hover {
  background: rgba(46, 204, 113, 0.3);
  border-color: rgba(46, 204, 113, 0.6);
}

/* Botón omitir */
.skip-btn {
  width: auto;
  height: 45px;
  border-radius: 25px;
  padding: 0 20px;
  gap: 8px;
  min-width: 100px;
}

.skip-btn:hover {
  background: rgba(231, 76, 60, 0.3);
  border-color: rgba(231, 76, 60, 0.6);
}

.skip-text {
  font-size: 14px;
  font-weight: 600;
}

/* Iconos */
.control-btn i {
  font-size: inherit;
  transition: transform 0.2s ease;
}

.control-btn:hover i {
  transform: scale(1.1);
}

/* Estados de iconos */
.play-icon,
.pause-icon {
  position: absolute;
  transition: opacity 0.2s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Loading de video */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 10;
}

.video-loading.hidden {
  display: none;
}

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

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

.video-loading p {
  margin: 0;
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Efectos hover mejorados */
.control-btn::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: inherit;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.control-btn:hover::before {
  opacity: 1;
}

/* ========================================
   ⭐ MEJORAS PARA ANIMATE.CSS ⭐
   ======================================== */

/* Estados globales de pantallas */
.screen.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.screen.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Hacer las animaciones más suaves */
.animate__animated {
  animation-fill-mode: both;
}

/* Velocidades personalizadas */
.animate__faster {
  animation-duration: 0.5s;
}

.animate__fast {
  animation-duration: 0.8s;
}

.animate__slow {
  animation-duration: 1.2s;
}

/* SlideInUp más suave para video container */
.video-container.animate__slideInUp {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* SlideOutDown más rápido para video container */
.video-container.animate__slideOutDown {
  animation-duration: 0.4s;
  animation-timing-function: ease-in;
}

/* Responsivo para pantalla de video */
@media (max-width: 768px) {
  .video-screen {
    padding: 15px;
  }
  
  .video-container {
    max-width: 95vw;
    max-height: 75vh;
    width: min(95vw, calc(75vh * 16/9));
    height: min(75vh, calc(95vw * 9/16));
    border-radius: 8px;
  }
  
  .video-controls {
    padding: 15px 20px;
  }
  
  .controls-center {
    gap: 15px;
  }
  
  .restart-btn {
    width: 40px;
    height: 40px;
  }
  
  .play-pause-btn {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
  
  .skip-btn {
    height: 40px;
    padding: 0 15px;
    min-width: 80px;
  }
  
  .time-display {
    font-size: 14px;
    min-width: 100px;
  }
  
  .skip-text {
    font-size: 13px;
  }
  
  /* Animaciones más rápidas en móvil */
  .video-container.animate__slideInUp {
    animation-duration: 0.4s;
  }
  
  .video-container.animate__slideOutDown {
    animation-duration: 0.3s;
  }
}

@media (max-width: 480px) {
  .video-screen {
    padding: 10px;
  }
  
  .video-container {
    max-width: 98vw;
    max-height: 70vh;
    width: min(98vw, calc(70vh * 16/9));
    height: min(70vh, calc(98vw * 9/16));
    border-radius: 6px;
  }
  
  .video-controls {
    padding: 12px 15px;
    flex-direction: column;
    gap: 15px;
  }
  
  .controls-left,
  .controls-right {
    flex: none;
  }
  
  .controls-center {
    gap: 12px;
  }
  
  .restart-btn {
    width: 36px;
    height: 36px;
  }
  
  .play-pause-btn {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  
  .skip-btn {
    height: 36px;
    padding: 0 12px;
    min-width: 70px;
  }
  
  .time-display {
    font-size: 12px;
    min-width: 90px;
    text-align: center;
  }
  
  .skip-text {
    font-size: 12px;
  }
  
  /* Animaciones aún más rápidas en móviles pequeños */
  .video-container.animate__slideInUp {
    animation-duration: 0.3s;
  }
  
  .video-container.animate__slideOutDown {
    animation-duration: 0.2s;
  }
}

/* Animaciones adicionales */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.control-btn.loading {
  animation: pulse 1.5s infinite;
}

/* Estados de foco para accesibilidad */
.control-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* ========================================
   ⭐ OPTIMIZACIONES DE PERFORMANCE ⭐
   ======================================== */

/* Para dispositivos con batería baja o conexión lenta */
@media (prefers-reduced-motion: reduce) {
  .video-container.animate__slideInUp,
  .video-container.animate__slideOutDown {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  
  .control-btn,
  .animate__animated {
    animation: none !important;
    transition: none !important;
  }
}