/* =========================================
   VENTANA MODAL DE VIDEO (PROFESIONAL)
   ========================================= */

/* Indicador de que la imagen es clicable */
.video-modal-trigger {
  cursor: pointer;
  transition: transform 0.3s var(--ease-mech), box-shadow 0.3s ease;
}

.video-modal-trigger:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-floating);
}

/* Ícono de Play superpuesto en la imagen */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 4;
  border-radius: 16px;
}

.video-modal-trigger:hover .play-overlay {
  opacity: 1;
}

.play-overlay i {
  font-size: 4rem;
  color: #ffffff;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transform: scale(0.8);
  transition: transform 0.3s var(--ease-mech);
}

.video-modal-trigger:hover .play-overlay i {
  transform: scale(1);
}

/* Contenedor principal del modal (oculto por defecto) */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Estado activo del modal */
.video-modal.is-active {
  opacity: 1;
  visibility: visible;
}

/* Fondo oscuro con desenfoque */
.video-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Caja contenedora del video */
.video-modal-container {
  position: relative;
  width: 90%;
  max-width: 960px;
  background: var(--background, #e0e5ec);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s var(--ease-mech), width 0.4s ease, max-width 0.4s ease, border-radius 0.4s ease;
  z-index: 10;
  overflow: hidden;
}

.video-modal.is-active .video-modal-container {
  transform: scale(1) translateY(0);
}

/* Estado Maximizado */
.video-modal.is-maximized .video-modal-container {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  border-radius: 0;
}

/* Cabecera del modal */
.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(224, 229, 236, 0.95);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--border-dark, #a3b1c6);
}

.video-modal-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text, #2d3436);
  letter-spacing: 0.05em;
}

/* Controles (Maximizar / Cerrar) */
.video-modal-controls {
  display: flex;
  gap: 8px;
}

.video-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #2d3436);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.video-modal-btn:hover {
  background: var(--muted, #d1d9e6);
  color: var(--accent, #ff4757);
}

.video-modal-btn:active {
  transform: scale(0.95);
}

.video-modal-btn#modalCloseBtn:hover {
  background: var(--accent, #ff4757);
  color: #ffffff;
}

/* Cuerpo del modal (contiene el video) */
.video-modal-body {
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Elemento de video */
.video-modal-body video {
  width: 100%;
  max-height: 70vh;
  display: block;
  outline: none;
}

/* Ajustes del video en modo maximizado */
.video-modal.is-maximized .video-modal-body video {
  max-height: calc(100vh - 68px); /* Resta la altura del header */
  height: calc(100vh - 68px);
  object-fit: contain;
}

/* Ajustes responsivos para móviles */
@media (max-width: 768px) {
  .video-modal-container {
    width: 95%;
    border-radius: 12px;
  }

  .video-modal-header {
    padding: 12px 16px;
  }

  .video-modal-title {
    font-size: 0.75rem;
  }

  .video-modal-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .play-overlay i {
    font-size: 3rem;
  }
}

@media (max-width: 380px) {
  .video-modal-title {
    display: none; /* Oculta el título en pantallas muy pequeñas para dar espacio a los botones */
  }
  
  .video-modal-header {
    justify-content: flex-end;
  }
}

/* Botón de descarga para fallback */
.btn-download:hover {
  background: #ff6b7a;
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.btn-download:active {
  transform: translateY(0);
}