﻿/**
 * =============================================================================
 * CONTENT/TERCERA_EDAD/RECURSOS_APOYO.CSS - Estilos de Recursos de Apoyo
 * =============================================================================
 * 
 * Este archivo CSS define la apariencia visual de la página de recursos de apoyo para personas mayores.
 * Es utilizado por: content/tercera_edad/recursos_apoyo.html
 * 
 * Página con recursos, enlaces y herramientas de apoyo para adultos mayores.
 * 
 * =============================================================================
 * ESTRUCTURA DEL ARCHIVO:
 * =============================================================================
 * 1. IMPORTS     - Importar estilos base del index
 * 2. HERO      - Sección principal
 * 3. INTRODUCCIÓN - Texto introductorio
 * 4. RECURSOS GRID - Grid de recursos
 * 5. TARJETAS - Estilos de tarjetas
 * 6. CATEGORÍAS - Secciones por categorías
 * 7. CARRUSELES - Estilos de Swiper
 * 8. DROPDOWN - Botones desplegables
 * 9. SEPARADOR - Imagen separadora
 * 10. ANIMACIONES - Keyframes
 * 11. RESPONSIVE - Ajustes para móviles
 * 12. PREFERENCES - Soporte prefers-reduced-motion
 * 
 * =============================================================================
 */

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

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

/* =============================================================================
SECCIÓN 2: HERO SECTION
================================================================================
Sección principal con título y fondo decorativo.
*/

/* Hero para mayores */
.mayores-hero {
  position: relative;
  background: var(--bg-gradient);
  color: white;
  padding: 6rem 0 8rem;
  overflow: hidden;
  margin-bottom: 0;
}

/* Fondo decorativo */
.mayores-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 20% 80%,
      rgba(42, 157, 143, 0.25) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(233, 196, 106, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(38, 70, 83, 0.3) 0%,
      transparent 70%
    );
  animation: float3D 8s ease-in-out infinite;
}

/* Contenido del hero */
.mayores-hero-content {
  position: relative;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  z-index: 1;
}

/* Badge decorativo */
.mayores-hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInDown 0.6s ease;
}

/* Título */
.mayores-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: white;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.mayores-hero h1 .highlight {
  color: var(--accent);
}

/* Subtítulo */
.mayores-hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.95;
  margin-bottom: 0;
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* Onda decorativa */
.mayores-hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  line-height: 0;
}

.mayores-hero-wave svg {
  width: 100%;
  height: 80px;
  display: block;
}

/* =============================================================================
SECCIÓN 3: INTRODUCCIÓN
================================================================================
Texto introductorio.
*/

/* Introducción */
.mayores-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  animation: fadeInUp 0.6s ease-out;
}

.mayores-intro h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.mayores-intro p {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.7;
}

/* =============================================================================
SECCIÓN 4: RECURSOS GRID
================================================================================
Grid de recursos.
*/

/* Grid de recursos - 3 columnas */
.recursos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 0 1.5rem;
  max-width: 1200px;
  margin: 0 auto 4rem;
}

/* =============================================================================
SECCIÓN 5: TARJETAS
================================================================================
Estilos para las tarjetas de recursos.
*/

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

/* Delays escalonados */
.recurso-card:nth-child(1) { animation-delay: 0.05s; }
.recurso-card:nth-child(2) { animation-delay: 0.1s; }
.recurso-card:nth-child(3) { animation-delay: 0.15s; }
.recurso-card:nth-child(4) { animation-delay: 0.2s; }
.recurso-card:nth-child(5) { animation-delay: 0.25s; }
.recurso-card:nth-child(6) { animation-delay: 0.3s; }

/* Barra decorativa */
.recurso-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);
}

/* Hover */
.recurso-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

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

/* Efecto shimmer */
.recurso-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;
}

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

/* Icono */
.recurso-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  transition: transform var(--transition);
}

.recurso-card:hover .recurso-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Título y descripción */
.recurso-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
  transition: color var(--transition-fast);
}

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

.recurso-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

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

/* =============================================================================
SECCIÓN 6: CATEGORÍAS
================================================================================
Secciones de recursos por categorías.
*/

/* Categoría de recursos */
.recursos-category {
  margin-bottom: 4rem;
  padding: 0 1.5rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.recursos-category h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text);
  text-align: left;
  animation: fadeInUp 0.6s ease-out;
}

.recursos-category > p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* =============================================================================
SECCIÓN 7: CARRUSELES (SWIPER)
================================================================================
Estilos para los carruseles de Swiper.
*/

/* Contenedor del carrusel */
.swiper {
  width: 100%;
  padding: 20px 0 40px;
}

/* Slide del carrusel */
.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Tarjeta dentro del slide */
.swiper-slide a.recurso-card {
  display: block;
  width: 100%;
  max-width: 250px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.5s ease forwards;
}

/* Delays */
.swiper-slide:nth-child(1) a.recurso-card { animation-delay: 0.05s; }
.swiper-slide:nth-child(2) a.recurso-card { animation-delay: 0.1s; }
.swiper-slide:nth-child(3) a.recurso-card { animation-delay: 0.15s; }
.swiper-slide:nth-child(4) a.recurso-card { animation-delay: 0.2s; }
.swiper-slide:nth-child(5) a.recurso-card { animation-delay: 0.25s; }
.swiper-slide:nth-child(6) a.recurso-card { animation-delay: 0.3s; }

/* Imagen del slide */
.swiper-slide img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  transition: transform var(--transition);
  box-shadow: var(--shadow);
}

.swiper-slide a.recurso-card:hover img {
  transform: scale(1.05);
}

/* Botones de navegación */
.swiper-button-next,
.swiper-button-prev {
  color: var(--primary);
}

/* =============================================================================
SECCIÓN 8: DROPDOWN
================================================================================
Botones y contenidos desplegables.
*/

/* Botón toggle del dropdown */
.dropdown-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

.dropdown-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.dropdown-toggle-btn h2 {
  font-size: 1.25rem;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dropdown-toggle-btn h2 i {
  color: white;
}

.dropdown-toggle-btn .toggle-icon {
  color: white;
  font-size: 1rem;
  transition: transform var(--transition);
}

.dropdown-toggle-btn[aria-expanded='true'] .toggle-icon {
  transform: rotate(180deg);
}

/* Contenido del dropdown */
.dropdown-content {
  padding: 1rem 0;
  animation: fadeIn 0.3s ease;
}

.dropdown-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Wrapper para botón de favorito */
.recurso-card-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.recurso-card-wrapper .recurso-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Contenido de la tarjeta */
.recurso-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recurso-content h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  transition: color var(--transition-fast);
}

.recurso-card:hover .recurso-content h4 {
  color: var(--primary);
}

.recurso-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

/* Imagen del recurso */
.recurso-image {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--bg-alt);
}

.recurso-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

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

/* Enlace de descarga */
.recurso-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.recurso-link i {
  transition: transform var(--transition-fast);
}

.recurso-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.recurso-link:hover i {
  transform: translateX(4px);
}

/* Botón de favorito */
.recurso-content .btn-favorite {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: linear-gradient(135deg, #ffd700 0%, #ffc107 100%);
  color: #1a1a1a;
  border: none;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
  z-index: 10;
}

.recurso-content .btn-favorite:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.5);
  background: linear-gradient(135deg, #ffe44d 0%, #ffd700 100%);
}

.recurso-content .btn-favorite i {
  font-size: 0.8rem;
}

/* Estado cuando ya está en favoritos */
.recurso-content .btn-favorite.favorited {
  background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
  color: #1a1a1a;
}

.recurso-content .btn-favorite.favorited:hover {
  background: linear-gradient(135deg, #ffca28 0%, #ffc107 100%);
}

/* Grid de recursos con mejor spacing */
.recursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

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

.recurso-card .recurso-content {
  padding: 1.5rem;
}

/* Delays escalonados - más recursos (hasta 30) */
.recurso-card:nth-child(7) { animation-delay: 0.35s; }
.recurso-card:nth-child(8) { animation-delay: 0.4s; }
.recurso-card:nth-child(9) { animation-delay: 0.45s; }
.recurso-card:nth-child(10) { animation-delay: 0.5s; }
.recurso-card:nth-child(11) { animation-delay: 0.55s; }
.recurso-card:nth-child(12) { animation-delay: 0.6s; }
.recurso-card:nth-child(13) { animation-delay: 0.65s; }
.recurso-card:nth-child(14) { animation-delay: 0.7s; }
.recurso-card:nth-child(15) { animation-delay: 0.75s; }
.recurso-card:nth-child(16) { animation-delay: 0.8s; }
.recurso-card:nth-child(17) { animation-delay: 0.85s; }
.recurso-card:nth-child(18) { animation-delay: 0.9s; }
.recurso-card:nth-child(19) { animation-delay: 0.95s; }
.recurso-card:nth-child(20) { animation-delay: 1s; }
.recurso-card:nth-child(21) { animation-delay: 1.05s; }
.recurso-card:nth-child(22) { animation-delay: 1.1s; }
.recurso-card:nth-child(23) { animation-delay: 1.15s; }
.recurso-card:nth-child(24) { animation-delay: 1.2s; }
.recurso-card:nth-child(25) { animation-delay: 1.25s; }
.recurso-card:nth-child(26) { animation-delay: 1.3s; }
.recurso-card:nth-child(27) { animation-delay: 1.35s; }
.recurso-card:nth-child(28) { animation-delay: 1.4s; }
.recurso-card:nth-child(29) { animation-delay: 1.45s; }
.recurso-card:nth-child(30) { animation-delay: 1.5s; }

/* =============================================================================
SECCIÓN 9: SEPARADOR
================================================================================
Imagen separadora.
*/

/* Separador */
.mayores-separator {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.mayores-separator img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  opacity: 0.8;
  transition:
    opacity var(--transition),
    transform var(--transition);
}

.mayores-separator img:hover {
  opacity: 1;
  transform: scale(1.01);
}

/* =============================================================================
SECCIÓN 10: ANIMACIONES
================================================================================
Keyframes.
*/

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float3D {
  0%,
  100% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: translateY(-8px) rotateX(2deg) rotateY(2deg);
  }
  50% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg);
  }
  75% {
    transform: translateY(-4px) rotateX(-2deg) rotateY(-2deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 1024px) {
  .recursos-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .mayores-hero {
    padding: 4rem 0 6rem;
  }

  .mayores-hero h1 {
    font-size: 2rem;
  }

  .mayores-hero-subtitle {
    font-size: 1rem;
  }

  .recursos-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .recursos-grid {
    grid-template-columns: 1fr;
  }

  .recurso-image {
    height: 140px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .recurso-card,
  .swiper-slide a {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .mayores-hero-bg {
    animation: none;
  }
  .recurso-card::after {
    display: none;
  }
}

