/* Estilos específicos para la página de videos */



/* Contenedor principal - Desktop: NO SCROLL */
.content-box {
  position: fixed;
  top: 6.5rem;
  bottom: 4rem;
  /* Espacio para footer */
  left: 50%;
  transform: translateX(-50%);
  width: 96vw;
  max-width: 1600px;
  border: 2px solid #ffffff;
  padding: 2rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
  overflow: hidden;
  /* Crucial */
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
}

.page-title {
  text-align: center;
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Contenedor de las dos secciones */
.sections-container {
  display: flex;
  gap: 2rem;
  flex: 1;
  min-height: 0;
  /* Permite shrink */
  overflow: visible;
}

/* Sección izquierda */
.left-section {
  flex: 0 0 45%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.featured-videos {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.featured-video-card {
  position: relative;
  width: 100%;
  flex: 1;
  /* Ocupar espacio vertical disponible */
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.6);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.featured-video-card:hover {
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.featured-video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.featured-video-card:hover .featured-video-thumbnail {
  transform: scale(1.05);
}

.featured-video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.featured-video-overlay svg {
  width: 20px;
  height: 20px;
  fill: #000;
  margin-left: 3px;
}

.featured-video-card:hover .featured-video-overlay {
  background: rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%) scale(1.1);
}

.featured-video-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 5;
}

.featured-video-card:hover .featured-video-info {
  transform: translateY(0);
}

.featured-video-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.featured-video-description {
  font-size: 0.85rem;
  color: #cccccc;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  /* Standard property */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sección derecha */
.right-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  position: relative;
  height: 100%;
  overflow: visible;
  padding: 0;
  /* Sin padding extra que cause desbordamiento */
}

/* Grid de videos */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto;
  gap: 1rem;
  flex: 0 1 auto;
  /* No forzar a ocupar todo si no es necesario */
  /* Removed fixed height to allow dots to fit */
  min-height: 0;
}

.small-video-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* Forzar proporción para que quepan 4 en el grid */
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.small-video-card:hover {
  border-color: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.small-video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.small-video-card:hover .small-video-thumbnail {
  transform: scale(1.03);
}

.small-video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 15;
  /* Z-index más alto que el overlay */
  opacity: 0.9;
  pointer-events: auto;
  /* Asegurar que sea clickeable */
  cursor: pointer;
}

.small-video-play-button svg {
  width: 60px;
  height: 60px;
  fill: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.small-video-card:hover .small-video-play-button {
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 1;
}

.small-video-card:hover .small-video-play-button svg {
  fill: rgba(255, 255, 255, 1);
}

.small-video-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.6) 80%,
      transparent 100%);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  justify-content: flex-end;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
  /* Asegurar que esté debajo del botón de reproducción */
  pointer-events: none;
  /* Permitir clicks en el botón de reproducción */
}

.small-video-card:hover .small-video-overlay {
  opacity: 1;
}

.small-video-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  /* Permitir hasta 3 líneas para que no se recorte */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  word-wrap: break-word;
  /* Permitir que las palabras largas se dividan */
}

.small-video-description {
  display: none;
}

.small-video-date {
  display: none;
  /* Ocultar año en versión web, solo mostrar título */
}

/* Modal */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  overflow-y: auto;
  padding: 2rem;
  box-sizing: border-box;
}

.video-modal.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 1400px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: row;
  gap: 2rem;
  position: relative;
  background: transparent;
  align-items: flex-start;
}

.modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 2001;
}

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

.modal-video-wrapper {
  position: relative;
  flex: 0 0 65%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 2px solid #ffffff;
  min-width: 0;
}

.modal-video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: white;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}

.modal-social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-social-link {
  width: 40px;
  height: 40px;
  color: #ffffff;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.modal-social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-3px);
}

.modal-social-link svg {
  width: 20px;
  height: 20px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.modal-description {
  font-size: 0.95rem;
  color: #cccccc;
  line-height: 1.6;
  margin: 0;
}

.modal-date {
  font-size: 0.9rem;
  color: #a0a0a0;
  margin: 0;
}

/* Flechas de navegación (Laterales) */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
  z-index: 20;
}

.left-arrow {
  left: 10px;
}

.right-arrow {
  right: 10px;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
  border-color: #ffffff;
}

.nav-arrow:disabled,
.nav-arrow[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Ajuste espacio para flechas en desktop */
.right-section {
  padding: 0;
  position: relative;
  overflow: visible;
}

/* === RESPONSIVE === */

/* Tablet (max-width: 968px) */
@media (max-width: 968px) {
  .content-box {
    position: fixed;
    top: 7rem;
    bottom: 4rem;
    width: 95vw;
    height: auto;
    padding: 2rem;
    overflow-y: auto;
    display: block;
  }

  .sections-container {
    flex-direction: column;
    gap: 2rem;
    height: auto;
    overflow: visible;
  }

  .left-section,
  .right-section {
    flex: none;
    height: auto;
    width: 100%;
    overflow: visible;
    padding: 0;
    /* Quitar padding de flechas */
  }

  /* Ocultar completamente los botones de navegación en móvil */
  .nav-arrow {
    display: none !important;
  }

  .featured-videos {
    flex-direction: row;
    height: auto;
    gap: 1rem;
  }

  .featured-video-card {
    aspect-ratio: 16/9;
    flex: 1;
  }

  .videos-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    grid-auto-rows: auto;
    height: auto;
    gap: 1.5rem;
  }

  .small-video-card {
    aspect-ratio: 16/9;
    height: auto;
  }

  .small-video-overlay {
    opacity: 1;
  }

  .modal-content {
    flex-direction: column;
    padding-top: 1rem;
    max-height: none;
    overflow-y: visible;
  }

  .modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
  }
}

/* Mobile (max-width: 640px) */
@media (max-width: 640px) {
  /* EXACTAMENTE IGUAL QUE BIOGRAFÍA - Copiado línea por línea */
  .videos-page .content-box {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: calc(100vw - 2rem) !important;
    max-width: none !important;
    margin: 4.5rem 1rem 1rem 1rem !important;
    /* Margen superior: altura del header (~3.5rem) + margen (1rem) = 4.5rem para estar más cerca del header */
    padding: 1.5rem !important;
    border: 2px solid #ffffff !important;
    box-sizing: border-box !important;
    min-height: auto !important;
    max-height: calc(100vh - 6.5rem) !important;
    /* Altura máxima para permitir scroll */
    height: auto !important;
    gap: 1rem !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    /* Permitir scroll dentro de la sección */
  }

  .videos-page .sections-container {
    padding: 0 !important;
    gap: 1.5rem !important;
    margin-bottom: 0 !important;
    min-height: auto !important;
    height: auto !important;
  }

  .videos-page .page-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding: 0 !important;
  }

  /* Ocultar sección izquierda en móvil */
  .videos-page .left-section {
    display: none !important;
  }

  .videos-page .featured-video-card {
    display: none !important;
  }

  /* Sección derecha - sin restricciones de altura */
  .videos-page .right-section {
    min-height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* Videos grid - layout vertical sin restricciones */
  .videos-page .videos-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    scroll-snap-type: none !important;
    -webkit-overflow-scrolling: auto !important;
  }

  /* Espaciado entre videos */
  .videos-page .small-video-card:not(:last-child) {
    margin-bottom: 1.5rem !important;
  }

  .videos-page .small-video-card:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .videos-page .featured-video-info,
  .videos-page .small-video-overlay {
    background: rgba(0, 0, 0, 0.75);
    opacity: 1;
    transform: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem !important;
    padding-top: 0.8rem !important;
    /* Padding reducido arriba para no tapar el botón */
    text-align: center;
    pointer-events: none;
    /* Permitir clicks en el botón de reproducción */
  }

  .videos-page .small-video-card:last-child .small-video-overlay {
    padding-bottom: 0.5rem !important;
  }

  .videos-page .small-video-play-button {
    opacity: 1;
  }

  .videos-page .small-video-play-button svg {
    width: 70px;
    height: 70px;
  }

  .videos-page .small-video-title {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
    text-align: center;
  }

  .videos-page .small-video-description {
    display: block !important;
    font-size: 0.95rem;
    color: #cccccc;
    margin-bottom: 1rem;
    line-height: 1.4;
    text-align: center;
    max-width: 90%;
  }

  .videos-page .small-video-card:last-child .small-video-description {
    margin-bottom: 0.5rem !important;
  }

  .videos-page .small-video-date {
    font-size: 1.1rem !important;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0 !important;
  }

  /* Cards de video - sobrescribir common.css completamente */
  .videos-page .small-video-card {
    width: 100% !important;
    min-width: 100% !important;
    /* Sobrescribir min-width: 80vw de common.css */
    flex: 0 0 100% !important;
    /* Sobrescribir flex: 0 0 80vw de common.css */
    aspect-ratio: 16/9 !important;
    height: auto !important;
    min-height: 180px !important;
    position: relative !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 2px solid rgba(255, 255, 255, 0.6) !important;
    scroll-snap-align: none !important;
  }

  /* Ocultar botones de navegación en móvil */
  .videos-page .nav-arrow {
    display: none !important;
  }

  .logo {
    font-size: 1rem;
  }
}