/* ===== ELEMENTOS ANIMADOS PARA DAR VIDA AL DISEÑO ===== */

/* Partículas flotantes de fondo */
.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
  width: 8px;
  height: 8px;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 8s;
}

.particle:nth-child(2) {
  width: 12px;
  height: 12px;
  left: 20%;
  animation-delay: 1s;
  animation-duration: 10s;
}

.particle:nth-child(3) {
  width: 6px;
  height: 6px;
  left: 30%;
  animation-delay: 2s;
  animation-duration: 7s;
}

.particle:nth-child(4) {
  width: 10px;
  height: 10px;
  left: 40%;
  animation-delay: 3s;
  animation-duration: 9s;
}

.particle:nth-child(5) {
  width: 14px;
  height: 14px;
  left: 50%;
  animation-delay: 4s;
  animation-duration: 11s;
}

.particle:nth-child(6) {
  width: 8px;
  height: 8px;
  left: 60%;
  animation-delay: 5s;
  animation-duration: 8s;
}

.particle:nth-child(7) {
  width: 16px;
  height: 16px;
  left: 70%;
  animation-delay: 6s;
  animation-duration: 12s;
}

.particle:nth-child(8) {
  width: 6px;
  height: 6px;
  left: 80%;
  animation-delay: 7s;
  animation-duration: 7s;
}

.particle:nth-child(9) {
  width: 12px;
  height: 12px;
  left: 90%;
  animation-delay: 8s;
  animation-duration: 10s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  50% {
    transform: translateY(-10vh) rotate(180deg);
    opacity: 0.8;
  }
}

/* Efectos de brillo en los iconos */
.category-icon {
  position: relative;
  overflow: hidden;
}

.category-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  transform: rotate(45deg);
  animation: iconShine 3s ease-in-out infinite;
  opacity: 0;
}

.category-card:hover .category-icon::after {
  opacity: 1;
  animation: iconShine 1s ease-in-out;
}

@keyframes iconShine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Ondas de fondo animadas */
.wave-background {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%23ff6b35"/><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%23ff6b35"/><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%23ff6b35"/></svg>') repeat-x;
  background-size: 1200px 120px;
  animation: waveMove 10s linear infinite;
  opacity: 0.1;
}

@keyframes waveMove {
  0% {
    background-position-x: 0;
  }
  100% {
    background-position-x: 1200px;
  }
}

/* Efectos de hover mejorados para las cards */
.category-card {
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
  transition: left 0.5s ease;
}

.category-card:hover::before {
  left: 100%;
}

/* Pulso sutil en los botones */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

/* Efectos de texto animado */
.animated-text {
  background: linear-gradient(45deg, #0d6efd, #1976d2, #3d8bfd, #42a5f5);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientText 4s ease-in-out infinite;
}

@keyframes gradientText {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Efectos de loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Efectos de parallax suave */
.parallax-element {
  transform: translateZ(0);
  will-change: transform;
}

/* Micro-interacciones */
.micro-bounce {
  transition: transform 0.2s ease;
}

.micro-bounce:hover {
  transform: scale(1.05);
}
.micro-bounce:active {
  transform: scale(0.95);
}

/* Animación de pulso para elementos importantes */
@keyframes brandPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

/* Animaciones de entrada escalonadas */
.stagger-animation {
  opacity: 0;
  transform: translateY(30px);
  animation: staggerIn 0.6s ease forwards;
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efectos de cursor personalizado */
.custom-cursor {
  cursor: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: #0d6efd;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid #0d6efd;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transition: all 0.3s ease;
  opacity: 0.5;
}

/* Efectos de scroll reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Efectos de typing animation */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid #0d6efd;
  white-space: nowrap;
  animation: typing 3s 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: #0d6efd; }
}

/* Efectos de morphing shapes */
.morphing-shape {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #0d6efd 0%, #1976d2 100%);
  border-radius: 50%;
  animation: morph 4s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 50%;
    transform: rotate(0deg);
  }
  25% {
    border-radius: 25% 75% 75% 25%;
    transform: rotate(90deg);
  }
  50% {
    border-radius: 75% 25% 25% 75%;
    transform: rotate(180deg);
  }
  75% {
    border-radius: 25% 75% 25% 75%;
    transform: rotate(270deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .floating-particles {
    display: none; /* Desactivar partículas en móvil para mejor rendimiento */
  }
  
  .wave-background {
    height: 60px;
    background-size: 800px 80px;
  }
  
  .morphing-shape {
    width: 60px;
    height: 60px;
  }
}

/* Reducir animaciones para usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .particle,
  .wave-background,
  .morphing-shape,
  .animated-text {
    animation: none;
  }
  
  .category-card::before,
  .btn-primary::before,
  .category-icon::after {
    display: none;
  }
}
