/* Animaciones y efectos */

/* Keyframes */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px hsl(217, 91%, 60%, 0.3);
  }
  to {
    box-shadow: 0 0 30px hsl(217, 91%, 60%, 0.6);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Clases de animación */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite alternate;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

.animate-bounce {
  animation: bounce 2s infinite;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

/* Efectos hover */
.hover-scale {
  transition: transform 0.2s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px hsl(217, 91%, 60%, 0.4);
}

/* Efectos de entrada con retraso */
.animate-delay-1 {
  animation-delay: 0.1s;
  animation-fill-mode: both;
}

.animate-delay-2 {
  animation-delay: 0.2s;
  animation-fill-mode: both;
}

.animate-delay-3 {
  animation-delay: 0.3s;
  animation-fill-mode: both;
}

.animate-delay-4 {
  animation-delay: 0.4s;
  animation-fill-mode: both;
}

.animate-delay-5 {
  animation-delay: 0.5s;
  animation-fill-mode: both;
}

.animate-delay-6 {
  animation-delay: 0.6s;
  animation-fill-mode: both;
}

/* Efectos de scroll */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Transiciones suaves para todos los elementos interactivos */
a, button, .btn, .card, .project-card, .skill-card, .stat-card {
  transition: var(--transition-smooth);
}

/* Efectos de foco para accesibilidad */
*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Efectos de loading */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    hsl(217, 91%, 60%, 0.2),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Reducir animaciones para usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Efectos de parallax sutiles */
.parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* Efectos de glass morphism */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Efectos de neomorfismo */
.neomorphic {
  background: var(--color-background);
  box-shadow: 
    8px 8px 16px hsl(220, 20%, 5%),
    -8px -8px 16px hsl(220, 20%, 9%);
}

.neomorphic:hover {
  box-shadow: 
    4px 4px 8px hsl(220, 20%, 5%),
    -4px -4px 8px hsl(220, 20%, 9%);
}

/* Efectos de texto */
.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-muted-foreground) 25%,
    var(--color-foreground) 50%,
    var(--color-muted-foreground) 75%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-text 2s ease-in-out infinite;
}

@keyframes shimmer-text {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Efectos de typing */
.typing {
  border-right: 2px solid var(--color-primary);
  animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
  white-space: nowrap;
  overflow: hidden;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-primary);
  }
}