/**
 * Landing Page - Sections Card Reveal Animations
 * AGEEMCTI A.C.
 *
 * Sistema de animaciones para secciones con:
 * - Gradientes únicos por sección
 * - Efecto card-reveal al entrar en viewport
 * - Animaciones suaves y profesionales
 * - Soporte responsive y reduced motion
 */

/* ============================================
   CONFIGURACIÓN GLOBAL DE SECCIONES
   ============================================ */

section[id] {
  position: relative;
  opacity: 0;
  animation: sectionReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Opacidad inicial para secciones no animadas */
section[id]:not(.animated) {
  opacity: 0;
  transform: translateY(40px);
}

section[id].animated {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

/* ============================================
   ANIMACIONES BASE
   ============================================ */

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   SECCIÓN INICIO / HERO
   ============================================ */

#inicio {
  background: linear-gradient(135deg, #1a2859 0%, #2d3f6f 50%, #1e3a5f 100%);
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#inicio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.1), transparent 70%);
  pointer-events: none;
}

#inicio .relative {
  animation: slideUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   SECCIÓN NOSOTROS
   ============================================ */

#nosotros {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 50%, #f0f0f0 100%);
  position: relative;
  padding: 5rem 1rem;
}

#nosotros::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#nosotros::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Animación de cards dentro de nosotros */
#nosotros .nosotros-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease,
              background-color 0.3s ease;
}

#nosotros .nosotros-card.visible {
  opacity: 1;
  transform: translateY(0);
}

#nosotros .nosotros-card:nth-child(1).visible { animation-delay: 0ms; }
#nosotros .nosotros-card:nth-child(2).visible { animation-delay: 150ms; }
#nosotros .nosotros-card:nth-child(3).visible { animation-delay: 300ms; }

#nosotros .nosotros-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(26, 40, 89, 0.15);
}

/* ============================================
   SECCIÓN MESA DIRECTIVA (DIRECTIVA)
   ============================================ */

#directiva {
  background: linear-gradient(135deg, #1a2859 0%, #2a4a8f 50%, #1f3a6a 100%);
  position: relative;
  padding: 5rem 1rem;
}

#directiva::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#directiva::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#directiva h2,
#directiva p {
  color: white;
  position: relative;
  z-index: 2;
}

/* Animación de miembros */
#directiva .member-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#directiva .member-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   SECCIÓN CURSOS
   ============================================ */

#cursos {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f3f4f6 100%);
  position: relative;
  padding: 5rem 1rem;
}

#cursos::before {
  content: '';
  position: absolute;
  top: 0;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#cursos::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Animación de cursos cards */
#cursos [class*="grid"] > div {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease,
              transform 0.3s ease;
}

#cursos [class*="grid"] > div.visible {
  opacity: 1;
  transform: translateY(0);
}

#cursos [class*="grid"] > div:nth-child(1).visible { animation-delay: 0ms; }
#cursos [class*="grid"] > div:nth-child(2).visible { animation-delay: 150ms; }
#cursos [class*="grid"] > div:nth-child(3).visible { animation-delay: 300ms; }

#cursos [class*="grid"] > div:hover {
  transform: translateY(-15px);
  box-shadow: 0 25px 50px rgba(26, 40, 89, 0.2);
}

/* ============================================
   SECCIÓN BLOG / NOTICIAS
   ============================================ */

#blog {
  background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 50%, #f0f0f0 100%);
  position: relative;
  padding: 5rem 1rem;
}

#blog::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Animación de articulos */
#blog article {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease;
}

#blog article.visible {
  opacity: 1;
  transform: translateY(0);
}

#blog article:nth-child(1).visible { animation-delay: 0ms; }
#blog article:nth-child(2).visible { animation-delay: 150ms; }
#blog article:nth-child(3).visible { animation-delay: 300ms; }

#blog article:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ============================================
   SECCIÓN GALERÍA
   ============================================ */

#galeria {
  background: linear-gradient(135deg, #1a2859 0%, #244278 50%, #1f3a6a 100%);
  position: relative;
  padding: 5rem 1rem;
}

#galeria::before {
  content: '';
  position: absolute;
  top: -15%;
  left: -5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#galeria::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#galeria h2,
#galeria p {
  color: white;
  position: relative;
  z-index: 2;
}

/* Animación de items galería */
#galeria [class*="grid"] > div {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#galeria [class*="grid"] > div.visible {
  opacity: 1;
  transform: scale(1);
}

#galeria [class*="grid"] > div:hover {
  transform: scale(1.05);
}

/* ============================================
   SECCIÓN CONTACTO
   ============================================ */

#contacto {
  background: linear-gradient(135deg, #1a2859 0%, #2a3f7a 50%, #1f3a6a 100%);
  position: relative;
  padding: 5rem 1rem;
}

#contacto::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#contacto::after {
  content: '';
  position: absolute;
  bottom: -5%;
  right: -5%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Animación de elementos contacto */
#contacto .contact-form,
#contacto .contact-info {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#contacto .contact-info {
  transform: translateX(30px);
}

#contacto .contact-form.visible,
#contacto .contact-info.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   ANIMACIONES DE ELEMENTOS INTERNOS
   ============================================ */

/* Animar textos de encabezados */
section[id] h1,
section[id] h2,
section[id] h3 {
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

section[id] p {
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.2s;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  section[id] {
    padding: 3rem 1rem !important;
  }

  #nosotros::before,
  #cursos::before,
  #galeria::before,
  #blog::before,
  #directiva::before,
  #contacto::before {
    width: 250px;
    height: 250px;
  }

  #nosotros::after,
  #cursos::after,
  #galeria::after,
  #directiva::after,
  #contacto::after {
    width: 200px;
    height: 200px;
  }

  section[id] h2 {
    font-size: 1.75rem;
  }
}

/* ============================================
   REDUCED MOTION - RESPETAR PREFERENCIAS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  section[id],
  section[id] h1,
  section[id] h2,
  section[id] h3,
  section[id] p,
  #nosotros .nosotros-card,
  #directiva .member-card,
  #cursos [class*="grid"] > div,
  #blog article,
  #galeria [class*="grid"] > div,
  #contacto .contact-form,
  #contacto .contact-info {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  @keyframes sectionReveal,
  @keyframes slideUp,
  @keyframes slideInLeft,
  @keyframes slideInRight,
  @keyframes scaleUp {
    from { opacity: 1; transform: none; }
    to { opacity: 1; transform: none; }
  }
}

/* ============================================
   UTILIDADES HELPERS
   ============================================ */

/* Helper para animar elementos con delay */
.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-400 { animation-delay: 400ms; }

/* Helper para secciones con fondo oscuro */
.section-dark h2,
.section-dark h3,
.section-dark p {
  color: white;
}

.section-light h2,
.section-light h3 {
  color: var(--color-navy);
}
