﻿/**
 * =============================================================================
 * CONTENT/NIÑOS/VIDEOS.CSS - Estilos de Vídeos para Niños
 * =============================================================================
 * 
 * Este archivo CSS define la apariencia visual de la página de vídeos para niños.
 * Es utilizado por: content/niños/videos.html
 * 
 * Página con vídeos educativos organizados por categorías.
 * 
 * =============================================================================
 * ESTRUCTURA DEL ARCHIVO:
 * =============================================================================
 * 1. IMPORTS         - Importar estilos base del index
 * 2. GRID VIDEOS    - Grid principal de vídeos
 * 3. TARJETA VIDEO  - Estilos de cada tarjeta de vídeo
 * 4. ICONO PLAY     - Botón de reproducción
 * 5. CONTENIDO      - Título y descripción
 * 6. CATEGORÍAS     - Secciones por categorías
 * 7. VÍDEO DESTACADO - Vídeos destacados
 * 8. ANIMACIONES   - Keyframes
 * 9. RESPONSIVE    - Ajustes para móviles
 * 10. PREFERENCES - Soporte prefers-reduced-motion
 * 
 * =============================================================================
 */

/* =============================================================================
SECCIÓN 1: IMPORTS
================================================================================
Importamos los estilos base del index.
*/

@import url('../../index/index.css');

/* =============================================================================
SECCIÓN 2: GRID DE VÍDEOS
================================================================================
Contenedor grid principal.
*/

/* Grid de vídeos */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* =============================================================================
SECCIÓN 3: TARJETA DE VÍDEO
================================================================================
Estilos para cada tarjeta de vídeo individual.
*/

/* Tarjeta de vídeo */
.video-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  /* Animación de entrada */
  opacity: 0;
  transform: translateY(30px);
  animation: slideUpFade 0.5s ease-out forwards;
}

/* Delays escalonados para animación - hasta 30 vídeos */
.video-card:nth-child(1) { animation-delay: 0.05s; }
.video-card:nth-child(2) { animation-delay: 0.1s; }
.video-card:nth-child(3) { animation-delay: 0.15s; }
.video-card:nth-child(4) { animation-delay: 0.2s; }
.video-card:nth-child(5) { animation-delay: 0.25s; }
.video-card:nth-child(6) { animation-delay: 0.3s; }
.video-card:nth-child(7) { animation-delay: 0.35s; }
.video-card:nth-child(8) { animation-delay: 0.4s; }
.video-card:nth-child(9) { animation-delay: 0.45s; }
.video-card:nth-child(10) { animation-delay: 0.5s; }
.video-card:nth-child(11) { animation-delay: 0.55s; }
.video-card:nth-child(12) { animation-delay: 0.6s; }
.video-card:nth-child(13) { animation-delay: 0.65s; }
.video-card:nth-child(14) { animation-delay: 0.7s; }
.video-card:nth-child(15) { animation-delay: 0.75s; }
.video-card:nth-child(16) { animation-delay: 0.8s; }
.video-card:nth-child(17) { animation-delay: 0.85s; }
.video-card:nth-child(18) { animation-delay: 0.9s; }
.video-card:nth-child(19) { animation-delay: 0.95s; }
.video-card:nth-child(20) { animation-delay: 1s; }
.video-card:nth-child(21) { animation-delay: 1.05s; }
.video-card:nth-child(22) { animation-delay: 1.1s; }
.video-card:nth-child(23) { animation-delay: 1.15s; }
.video-card:nth-child(24) { animation-delay: 1.2s; }
.video-card:nth-child(25) { animation-delay: 1.25s; }
.video-card:nth-child(26) { animation-delay: 1.3s; }
.video-card:nth-child(27) { animation-delay: 1.35s; }
.video-card:nth-child(28) { animation-delay: 1.4s; }
.video-card:nth-child(29) { animation-delay: 1.45s; }
.video-card:nth-child(30) { animation-delay: 1.5s; }

/* Barra decorativa superior */
.video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
  z-index: 1;
}

/* Hover de la tarjeta */
.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.video-card:hover::before {
  transform: scaleX(1);
}

/* Efecto shimmer al hover */
.video-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.video-card:hover::after {
  left: 100%;
}

/* =============================================================================
SECCIÓN 4: VÍDEO EMBEBIDO E IMAGEN
================================================================================
Estilos para reproductores de vídeo e imágenes miniatura.
*/

/* Contenedor para vídeo embebido (YouTube) */
.video-embed {
  position: relative;
  height: 200px;
  background: var(--bg-alt);
  overflow: hidden;
}

/* Iframe del vídeo */
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Contenedor de imagen miniatura */
.video-image {
  position: relative;
  height: 200px;
  background: var(--bg-alt);
  overflow: hidden;
}

/* Imagen de miniatura */
.video-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.video-card:hover .video-image img {
  transform: scale(1.05);
}

/* =============================================================================
SECCIÓN 5: ICONO DE REPRODUCCIÓN
================================================================================
Botón de play para los vídeos.
*/

/* Botón de reproducción */
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: #ff0000; /* Color rojo de YouTube */
  border-radius: 50%; /* Círculo perfecto */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: all var(--transition);
  animation: pulseGlow 2s ease-in-out infinite; /* Animación de pulso */
}

/* Icono de play */
.video-play i {
  color: #ffffff;
  font-size: 1.5rem;
  margin-left: 3px; /* Pequeño ajuste para centrar el triángulo */
}

/* Hover del botón de play */
.video-card:hover .video-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--primary); /* Cambia a verde al hover */
}

/* =============================================================================
SECCIÓN 6: CONTENIDO DE LA TARJETA
================================================================================
Título, descripción y duración del vídeo.
*/

/* Contenedor del contenido */
.video-content {
  padding: 1.5rem;
}

/* Título del vídeo */
.video-content h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  transition: color var(--transition-fast);
}

.video-card:hover .video-content h3 {
  color: var(--primary);
}

/* Descripción del vídeo */
.video-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

/* Duración del vídeo */
.video-duration {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
}

/* =============================================================================
SECCIÓN 7: MODO OSCURO
================================================================================
Ajustes para el modo oscuro.
*/

/* Botón de play en modo oscuro */
body.dark-mode .video-play,
.dark-mode .video-play {
  background: #ffffff;
}

body.dark-mode .video-play i,
.dark-mode .video-play i {
  color: #ff0000;
}

/* =============================================================================
SECCIÓN 8: ACCESIBILIDAD
================================================================================
Soporte para navegación por teclado.
*/

/* Focus visible para accesibilidad WCAG */
.video-card:focus-within {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* =============================================================================
SECCIÓN 9: VÍDEOS DESTACADOS
================================================================================
Estilos especiales para vídeos destacados.
*/

/* Vídeo destacado - ocupa más espacio */
.video-destacado {
  /* Ocupa todas las columnas del grid */
  grid-column: 1 / -1;
  display: grid;
  /* Dos columnas: imagen y contenido */
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

/* Imagen más grande para vídeo destacado */
.video-destacado .video-image {
  height: 350px;
}

/* =============================================================================
SECCIÓN 10: CATEGORÍAS
================================================================================
Secciones organizadas por categorías.
*/

/* Contenedor de categorías */
.video-categorias {
  margin-top: 3rem;
}

/* Categoría individual */
.video-categoria {
  margin-bottom: 2rem;
}

/* Título de categoría */
.video-categoria h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeInUp 0.6s ease-out;
}

/* Icono de la categoría */
.video-categoria h3 i {
  color: var(--primary);
  animation: iconBounce 2s ease-in-out infinite;
}

/* =============================================================================
SECCIÓN 11: ANIMACIONES
================================================================================
Definición de keyframes.
*/

/* Animación slide up + fade */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación de rebote para iconos */
@keyframes iconBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Animación de pulso para el botón de play */
@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(255, 0, 0, 0);
  }
}

/* =============================================================================
SECCIÓN 12: RESPONSIVE
================================================================================
Ajustes para dispositivos móviles.
*/

/* Tablets */
@media (max-width: 1024px) {
  .video-destacado {
    grid-template-columns: 1fr;
  }

  .video-destacado .video-image {
    height: 280px;
  }
}

/* Móviles grandes */
@media (max-width: 768px) {
  .videos-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .video-image {
    height: 180px;
  }

  .video-content {
    padding: 1.25rem;
  }

  .video-play {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .videos-grid {
    grid-template-columns: 1fr;
  }

  .video-image {
    height: 160px;
  }

  .video-content {
    padding: 1rem;
  }

  .video-content h3 {
    font-size: 1rem;
  }
}

/* =============================================================================
SECCIÓN 13: PREFERENCIAS DE USUARIO
================================================================================
Soporte para prefers-reduced-motion.
*/

/* Desactivar animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  .video-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .video-play {
    animation: none;
  }
  
  .video-categoria h3 i {
    animation: none;
  }
  
  .video-card::after {
    display: none;
  }
}

