/* ===== ANIMACIONES Y TRANSICIONES ===== */

/* Animaciones de entrada */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

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

/* Clases de animación */
.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-fade-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

/* Retrasos de animación */
.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-500 { animation-delay: 0.5s; }
.animation-delay-600 { animation-delay: 0.6s; }
.animation-delay-700 { animation-delay: 0.7s; }
.animation-delay-800 { animation-delay: 0.8s; }
.animation-delay-900 { animation-delay: 0.9s; }
.animation-delay-1000 { animation-delay: 1s; }

/* Duración de animación */
.animation-duration-100 { animation-duration: 0.1s; }
.animation-duration-200 { animation-duration: 0.2s; }
.animation-duration-300 { animation-duration: 0.3s; }
.animation-duration-400 { animation-duration: 0.4s; }
.animation-duration-500 { animation-duration: 0.5s; }
.animation-duration-600 { animation-duration: 0.6s; }
.animation-duration-700 { animation-duration: 0.7s; }
.animation-duration-800 { animation-duration: 0.8s; }
.animation-duration-900 { animation-duration: 0.9s; }
.animation-duration-1000 { animation-duration: 1s; }
.animation-duration-1500 { animation-duration: 1.5s; }
.animation-duration-2000 { animation-duration: 2s; }

/* Efecto de hover suave */
.hover-scale {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.dark-theme .hover-scale:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Efecto de elevación al pasar el ratón */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.dark-theme .hover-lift:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Efecto de pulso */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Efecto de rebote */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-bounce {
  animation: bounce 2s infinite;
}

/* Efecto de rotación */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Efecto de parpadeo */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-blink {
  animation: blink 1.5s infinite;
}

/* Efecto de desvanecimiento */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 300ms ease-in;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 300ms ease-in;
}

/* Efecto de slide */
.slide-enter {
  transform: translateX(100%);
  opacity: 0;
}

.slide-enter-active {
  transform: translateX(0);
  opacity: 1;
  transition: all 300ms ease-in-out;
}

.slide-exit {
  transform: translateX(0);
  opacity: 1;
}

.slide-exit-active {
  transform: translateX(-100%);
  opacity: 0;
  transition: all 300ms ease-in-out;
}

/* Efecto de zoom */
.zoom-enter {
  transform: scale(0.9);
  opacity: 0;
}

.zoom-enter-active {
  transform: scale(1);
  opacity: 1;
  transition: all 300ms ease-in-out;
}

.zoom-exit {
  transform: scale(1);
  opacity: 1;
}

.zoom-exit-active {
  transform: scale(0.9);
  opacity: 0;
  transition: all 300ms ease-in-out;
}

/* Efecto de barrido */
@keyframes sweep {
  0% { 
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.sweep {
  animation: sweep 0.5s ease-in-out;
}

/* Efecto de rebote suave */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.bounce-in {
  animation: bounceIn 0.75s ease-out;
}

/* Efecto de latido */
@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.1); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  70% { transform: scale(1); }
}

.heartbeat {
  animation: heartbeat 1.5s infinite;
}

/* Efecto de flotación */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Efecto de sacudida */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Efecto de rotación 3D */
@keyframes flipInY {
  from {
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
  }
  60% {
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}

.flip-in-y {
  backface-visibility: visible !important;
  animation: flipInY 1s ease-out;
}

/* Efecto de zoom con rotación */
@keyframes zoomInRotate {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-45deg);
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.zoom-in-rotate {
  animation: zoomInRotate 0.7s ease-out;
}

/* Efecto de onda */
@keyframes wave {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(-5deg); }
  20% { transform: rotate(10deg); }
  30% { transform: rotate(-5deg); }
  40% { transform: rotate(10deg); }
  50% { transform: rotate(-5deg); }
  60% { transform: rotate(5deg); }
  70% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
  90% { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}

.wave {
  display: inline-block;
  animation: wave 2s infinite;
  transform-origin: 70% 70%;
}

/* Efecto de aparición de texto */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  animation: typewriter 3.5s steps(40, end);
}

/* Efecto de brillo */
@keyframes shine {
  from {
    background-position: 200% center;
  }
  to {
    background-position: -200% center;
  }
}

.shine {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% auto;
  animation: shine 3s linear infinite;
}

/* Efecto de carga */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.shimmer {
  background: #f6f7f8;
  background-image: linear-gradient(
    to right,
    #f6f7f8 0%,
    #edeef1 20%,
    #f6f7f8 40%,
    #f6f7f8 100%
  );
  background-repeat: no-repeat;
  background-size: 1000px 100%;
  display: inline-block;
  position: relative;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.dark-theme .shimmer {
  background: #2d3748;
  background-image: linear-gradient(
    to right,
    #2d3748 0%,
    #4a5568 20%,
    #2d3748 40%,
    #2d3748 100%
  );
}

/* Efecto de carga con puntos */
@keyframes dot-flashing {
  0% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-5px); }
  100% { opacity: 0.2; transform: translateY(0); }
}

.dot-flashing {
  display: inline-flex;
  align-items: center;
  height: 10px;
}

.dot-flashing::before,
.dot-flashing::after,
.dot-flashing > div {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  margin: 0 2px;
  animation: dot-flashing 1.4s infinite ease-in-out;
}

.dot-flashing::before {
  animation-delay: 0s;
}

.dot-flashing > div {
  animation-delay: 0.2s;
}

.dot-flashing::after {
  animation-delay: 0.4s;
}

/* Clases de utilidad para animaciones */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: none;
}

.animate-on-hover:hover .hover-animate {
  animation: pulse 1s ease-in-out;
}

/* Efecto de máquina de escribir */
.typewriter-effect {
  overflow: hidden;
  border-right: 0.15em solid var(--primary);
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary); }
}

/* Efecto de carga de barra */
.progress-bar {
  height: 4px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--gray-200);
  border-radius: 2px;
}

.dark-theme .progress-bar {
  background-color: var(--gray-700);
}

.progress-bar-value {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: var(--primary);
  border-radius: 2px;
  animation: progress-indeterminate 2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% {
    left: -50%;
    width: 50%;
  }
  100% {
    left: 100%;
    width: 50%;
  }
}
