/* ========================================
   ANIMACIONES PROFESIONALES PARA SCROLL Y HOVER
   Archivo: animations.css
   
   ÍNDICE:
   1. Keyframes de Animación
   2. Animaciones de Scroll - Navbar
   3. Animaciones de Scroll - Hero Section
   4. Animaciones de Scroll - Sección Conócenos
   5. Animaciones de Scroll - Grid de Fianzas
   6. Animaciones de Scroll - Sección Contacto
   7. Efectos Hover - Navbar
   8. Efectos Hover - Hero Section
   9. Efectos Hover - Sección Conócenos
   10. Efectos Hover - Grid de Fianzas
   11. Efectos Hover - Formulario de Contacto
   
   NOTA: Las animaciones del footer han sido removidas de este archivo
   para evitar conflictos con footer-mejorado.css
   ======================================== */

/* ========================================
   1. KEYFRAMES DE ANIMACIÓN
   ======================================== */

/* Fade In desde abajo */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In desde arriba */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In desde la izquierda */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In desde la derecha */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In simple */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Scale In suave */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Línea de expansión horizontal */
@keyframes expandWidth {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Pulso suave */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Flotación sutil */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Slide In Scale */
@keyframes slideInScale {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ========================================
   2. ANIMACIONES DE SCROLL - NAVBAR
   ======================================== */

.navigation {
  animation: fadeInDown 0.6s ease-out;
}

.logo-link {
  animation: fadeInLeft 0.8s ease-out 0.2s both;
}



/* ========================================
   3. ANIMACIONES DE SCROLL - HERO SECTION
   ======================================== */

.hero-section {
  animation: fadeIn 1s ease-out;
}

.hero-title {
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-subtitle {
  animation: fadeInUp 1s ease-out 0.5s both;
}

.hero-buttons {
  animation: fadeInUp 1s ease-out 0.7s both;
}

.hero-btn {
  opacity: 0;
  animation: scaleIn 0.6s ease-out both;
}

.hero-btn:nth-child(1) {
  animation-delay: 0.9s;
}

.hero-btn:nth-child(2) {
  animation-delay: 1s;
}


/* ========================================
   4. ANIMACIONES DE SCROLL - SECCIÓN CONÓCENOS
   ======================================== */

/* Divider animado */
.conocenos-home .divider {
  width: 0;
  animation: expandWidth 1s ease-out 0.2s both;
}

/* Label "Explora" */
.conocenos-home .label.cc-light {
  animation: fadeInLeft 0.8s ease-out 0.4s both;
}

/* Título principal */
.conocenos-home .section-heading {
  animation: fadeInLeft 0.8s ease-out 0.6s both;
}

/* Párrafo con checkmarks */
.conocenos-home .paragraph-light {
  animation: fadeInLeft 0.8s ease-out 0.8s both;
}



/* ========================================
   5. ANIMACIONES DE SCROLL - GRID DE FIANZAS
   ======================================== */

/* Header de Fianzas */
.intro-header.cc-subpage {
  animation: fadeInDown 0.8s ease-out 0.2s both;
}

/* Cards de fianzas - animación escalonada */
.project-card {
  opacity: 0;
  animation: slideInScale 0.6s ease-out both;
}

/* Delay escalonado para cada card */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
.project-card:nth-child(7) { animation-delay: 0.7s; }
.project-card:nth-child(8) { animation-delay: 0.8s; }
.project-card:nth-child(9) { animation-delay: 0.9s; }
.project-card:nth-child(10) { animation-delay: 1s; }
.project-card:nth-child(11) { animation-delay: 1.1s; }
.project-card:nth-child(12) { animation-delay: 1.2s; }


/* ========================================
   6. ANIMACIONES DE SCROLL - SECCIÓN CONTACTO
   ======================================== */

/* Header de contacto */
.contact-header {
  animation: fadeInDown 0.8s ease-out 0.2s both;
}

/* Tarjeta de información */
.contact-info-card {
  animation: fadeInLeft 0.8s ease-out 0.4s both;
}

/* Items de contacto individuales */
.contact-info-item {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out both;
}

.contact-info-item:nth-child(1) { animation-delay: 0.6s; }
.contact-info-item:nth-child(2) { animation-delay: 0.7s; }
.contact-info-item:nth-child(3) { animation-delay: 0.8s; }



/* Campos del formulario */
.get-in-touch-form > div {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out both;
}

.get-in-touch-form > div:nth-child(1) { animation-delay: 0.7s; }
.get-in-touch-form > div:nth-child(2) { animation-delay: 0.8s; }
.get-in-touch-form > div:nth-child(3) { animation-delay: 0.9s; }
.get-in-touch-form > div:nth-child(4) { animation-delay: 1s; }

/* Botón de envío */
.get-in-touch-form input[type="submit"] {
  animation: scaleIn 0.6s ease-out 1.1s both;
}


/* ========================================
   REEMPLAZA ESTO EN TU ARCHIVO DE ANIMACIONES 
   (Sección 7. EFECTOS HOVER - NAVBAR)
   ======================================== */

.navigation-item {
    position: relative;
    /* Aseguramos que el padding sea consistente */
    padding: 0.6rem 0.6rem; 
    display: inline-block;
}

/* El pseudo-elemento debe estar centrado correctamente */
.navigation-item::after {
    content: '';
    position: absolute;
    bottom: 0;           /* Pegado al borde inferior del padding */
    left: 50%;           /* Empezar en el centro */
    transform: translateX(-50%); /* Centrar respecto a sí mismo */
    width: 0;
    height: 2px;
    background-color: var(--white, white);
    transition: width 0.3s ease;
}

.navigation-item:hover::after {
    width: 100%;        /* Se expande desde el centro hacia los lados */
}

/* Corregir la animación de entrada para que no choque */
@media (min-width: 992px) {
    .navigation-item {
        /* Usamos 'both' para que mantenga el estado final */
        animation: fadeInDown 0.6s ease-out both; 
    }
}

/* ========================================
   8. EFECTOS HOVER - HERO SECTION
   ======================================== */

/* Botones del hero con efectos suaves */
.hero-btn {
  position: relative;
  overflow: hidden;
}

.hero-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.hero-btn:hover::before {
  width: 300px;
  height: 300px;
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}


/* ========================================
   9. EFECTOS HOVER - SECCIÓN CONÓCENOS
   ======================================== */

/* Label con efecto de expansión */
.label.cc-light:hover::after {
  width: 60px;
  transition: width 0.3s ease;
}

/* Checkmarks con efecto de pulso */
.paragraph-light strong {
  display: inline-block;
  transition: transform 0.2s ease;
}

.paragraph-light:hover strong {
  transform: scale(1.2);
  color: #4745a0;
}

/* Botón Conócenos con efecto adicional */
.button-conocenos-grande:hover {
  animation: pulse 1s infinite;
}

.button-conocenos-grande:active {
  animation: none;
}


/* ========================================
   10. EFECTOS HOVER - GRID DE FIANZAS
   ======================================== */

/* Card con efecto de brillo */
.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
  pointer-events: none;
}

.project-card:hover::before {
  left: 100%;
}

/* Imagen con zoom suave */
.project-card:hover .project-cover-pic {
  transform: scale(1.1) rotate(2deg);
  transition: transform 0.5s ease;
}

/* Título con cambio de color suave */
.project-name-link {
  transition: color 0.3s ease, letter-spacing 0.3s ease;
}

.project-card:hover .project-name-link {
  letter-spacing: 0.5px;
}


/* ========================================
   11. EFECTOS HOVER - FORMULARIO DE CONTACTO
   ======================================== */

/* Iconos de contacto con rotación */
.contact-icon-wrapper {
  transition: transform 0.3s ease;
}

.contact-info-item:hover .contact-icon-wrapper {
  transform: rotate(10deg) scale(1.1);
}

/* Campos de formulario con efecto focus */
.text-field.cc-contact-field {
  transition: all 0.3s ease;
}

.text-field.cc-contact-field:focus {
  border-color: #5957b8;
  box-shadow: 0 0 0 3px rgba(89, 87, 184, 0.1);
  transform: translateY(-2px);
}

/* Botón de envío con efecto de onda */
.get-in-touch-form input[type="submit"] {
  position: relative;
  overflow: hidden;
}

.get-in-touch-form input[type="submit"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.get-in-touch-form input[type="submit"]:hover::after {
  width: 300px;
  height: 300px;
}

.get-in-touch-form input[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(89, 87, 184, 0.4);
}


/* ========================================
   RESPONSIVE - AJUSTES DE ANIMACIONES
   ======================================== */

/* Reducir animaciones en tablets */
@media (max-width: 991px) {
  /* Reducir duración de animaciones */
  .navigation,
  .hero-title,
  .hero-subtitle,
  .project-card {
    animation-duration: 0.5s;
  }
  
  /* Reducir delays */
  .navigation-item:nth-child(1) { animation-delay: 0.1s; }
  .navigation-item:nth-child(2) { animation-delay: 0.15s; }
  .navigation-item:nth-child(3) { animation-delay: 0.2s; }
  .navigation-item:nth-child(4) { animation-delay: 0.25s; }
}

/* Simplificar animaciones en móviles */
@media (max-width: 767px) {
  /* Remover delays complejos */
  .project-card:nth-child(n) {
    animation-delay: 0.1s;
  }
  
  /* Animaciones más rápidas */
  .hero-title,
  .hero-subtitle,
  .button-conocenos-grande {
    animation-duration: 0.4s;
  }
}

/* Desactivar animaciones para usuarios que prefieren reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ========================================
   ANIMACIONES AVANZADAS OPCIONALES
   ======================================== */

/* Parallax suave en scroll (requiere JavaScript) */
.parallax-element {
  transition: transform 0.1s linear;
}

/* Efecto de partículas flotantes (decorativo) */
@keyframes floatParticles {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.5;
  }
  25% {
    transform: translateY(-20px) translateX(10px);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-10px) translateX(-10px);
    opacity: 1;
  }
  75% {
    transform: translateY(-30px) translateX(5px);
    opacity: 0.6;
  }
}

/* Efecto de carga progresiva */
@keyframes progressLoad {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}


/* ========================================
   UTILIDADES DE ANIMACIÓN
   ======================================== */

/* Clase para animar elementos al hacer scroll */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Clase para delay personalizado */
.delay-100 { animation-delay: 0.1s !important; }
.delay-200 { animation-delay: 0.2s !important; }
.delay-300 { animation-delay: 0.3s !important; }
.delay-400 { animation-delay: 0.4s !important; }
.delay-500 { animation-delay: 0.5s !important; }

/* Clase para duración personalizada */
.duration-fast { animation-duration: 0.3s !important; }
.duration-normal { animation-duration: 0.6s !important; }
.duration-slow { animation-duration: 1s !important; }
