/* Archivo de animaciones para el sitio web escolar
 * Basado en las animaciones observadas en el sitio Excelsior
 */

/* ANIMACIONES DE ENTRADA */

/* FadeIn - Aparecer con fundido */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fadeIn {
  animation: fadeIn 1s ease forwards;
}

/* FadeInUp - Aparecer desde abajo */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 1s ease forwards;
}

/* FadeInDown - Aparecer desde arriba */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -50px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate-fadeInDown {
  animation: fadeInDown 1s ease forwards;
}

/* FadeInLeft - Aparecer desde la izquierda */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(-50px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate-fadeInLeft {
  animation: fadeInLeft 1s ease forwards;
}

/* FadeInRight - Aparecer desde la derecha */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(50px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate-fadeInRight {
  animation: fadeInRight 1s ease forwards;
}

/* ANIMACIONES DE DESLIZAMIENTO */

/* SlideInLeft - Deslizar desde la izquierda */
@keyframes slideInLeft {
  from {
    transform: translate3d(-100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

.animate-slideInLeft {
  animation: slideInLeft 1s ease forwards;
}

/* SlideInRight - Deslizar desde la derecha */
@keyframes slideInRight {
  from {
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

.animate-slideInRight {
  animation: slideInRight 1s ease forwards;
}

/* SlideInUp - Deslizar desde abajo */
@keyframes slideInUp {
  from {
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

.animate-slideInUp {
  animation: slideInUp 1s ease forwards;
}

/* ANIMACIONES DE ATENCIÓN */

/* Bounce - Rebote */
@keyframes bounce {
  from, 20%, 53%, 80%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

.animate-bounce {
  animation: bounce 1s ease;
}

/* Pulse - Pulso */
@keyframes pulse {
  from {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}

.animate-pulse {
  animation: pulse 1s ease infinite;
}

/* Flash - Destello */
@keyframes flash {
  from, 50%, to {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0;
  }
}

.animate-flash {
  animation: flash 1s ease;
}

/* Shake - Sacudida */
@keyframes shake {
  from, to {
    transform: translate3d(0, 0, 0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%, 40%, 60%, 80% {
    transform: translate3d(10px, 0, 0);
  }
}

.animate-shake {
  animation: shake 1s ease;
}

/* RubberBand - Efecto elástico */
@keyframes rubberBand {
  from {
    transform: scale3d(1, 1, 1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}

.animate-rubberBand {
  animation: rubberBand 1s ease;
}

/* TRANSFORMACIONES EN HOVER */

/* Grow - Crecer */
.transform-grow {
  transition: transform 0.3s ease;
}

.transform-grow:hover {
  transform: scale(1.1);
}

/* Shrink - Encoger */
.transform-shrink {
  transition: transform 0.3s ease;
}

.transform-shrink:hover {
  transform: scale(0.9);
}

/* Pulse-Grow - Pulso creciente */
@keyframes pulseGrow {
  to {
    transform: scale(1.1);
  }
}

.transform-pulse-grow:hover {
  animation: pulseGrow 0.3s ease-in-out infinite alternate;
}

/* Pulse-Shrink - Pulso decreciente */
@keyframes pulseShrink {
  to {
    transform: scale(0.9);
  }
}

.transform-pulse-shrink:hover {
  animation: pulseShrink 0.3s ease-in-out infinite alternate;
}

/* Float - Flotar */
.transform-float:hover {
  animation: float 0.3s ease-in-out;
  transform: translateY(-8px);
}

@keyframes float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

/* ANIMACIÓN DE ESTUDIANTES FLOTANTES */

@keyframes studentFloat {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-15px) rotate(5deg) scale(1.1);
  }
  50% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  75% {
    transform: translateY(10px) rotate(-5deg) scale(1.1);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes studentBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-20px) scale(1.2);
  }
  60% {
    transform: translateY(-10px) scale(1.1);
  }
}

.student-animation {
  position: absolute;
  z-index: 5;
  width: 80px; /* Aumentado el tamaño */
  height: 80px; /* Aumentado el tamaño */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.8; /* Añadida transparencia */
  transition: opacity 0.3s ease;
}

.student-animation:hover {
  opacity: 1;
  filter: drop-shadow(2px 4px 10px rgba(0, 0, 0, 0.5));
}

.student-animation.floating {
  animation: studentFloat 6s ease-in-out infinite;
}

.student-animation.bouncing {
  animation: studentBounce 2s infinite;
}

.student-animation.student1 {
  background-image: url('../img/student-icon1.png');
  top: 20%;
  right: 10%;
}

.student-animation.student2 {
  background-image: url('../img/student-icon2.png');
  bottom: 15%;
  left: 8%;
  animation-delay: 1s;
}

.student-animation.student3 {
  background-image: url('../img/student-icon3.png');
  top: 40%;
  left: 15%;
  animation-delay: 2s;
}

.student-animation.book {
  background-image: url('../img/book-icon.png');
  bottom: 25%;
  right: 15%;
  animation-delay: 1.5s;
}

.student-animation.graduation {
  background-image: url('../img/graduation-icon.png');
  top: 30%;
  left: 20%;
  animation-delay: 0.5s;
}

.section-with-students {
  position: relative;
  overflow: hidden;
}

/* ANIMACIONES PARA NAVBAR */

/* Efecto de flotación para iconos del navbar */
@keyframes navIconFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

.nav-icon-float {
  display: inline-block;
  transition: transform 0.3s ease;
}

.nav-icon-float:hover {
  animation: navIconFloat 1s ease infinite;
}

/* Efecto de limpieza para navbar al hacer scroll */
.clean-navbar {
  transition: all 0.5s ease;
  padding: 15px 0;
}

.clean-navbar.scrolled {
  padding: 8px 0;
  background: rgba(0, 59, 121, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* CLASES PARA ANIMACIÓN AL SCROLL */

/* Estas clases se utilizarán con JavaScript para animar elementos cuando aparecen en el viewport */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.fadeInUp-scroll {
  transform: translateY(50px);
}

.animate-on-scroll.fadeInDown-scroll {
  transform: translateY(-50px);
}

.animate-on-scroll.fadeInLeft-scroll {
  transform: translateX(-50px);
}

.animate-on-scroll.fadeInRight-scroll {
  transform: translateX(50px);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Retraso en animaciones */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Duración de animaciones */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }
