/* ===== ANIMACIONES AVANZADAS Y MICRO-INTERACCIONES ===== */

/* ===== VARIABLES DE ANIMACIÓN ===== */
:root {
  /* Duración de animaciones */
  --anim-duration-fast: 0.15s;
  --anim-duration-normal: 0.3s;
  --anim-duration-slow: 0.5s;
  --anim-duration-slower: 0.8s;
  
  /* Curvas de animación */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
  --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Delays escalonados */
  --delay-1: 0.1s;
  --delay-2: 0.2s;
  --delay-3: 0.3s;
  --delay-4: 0.4s;
  --delay-5: 0.5s;
}

/* ===== ANIMACIONES DE ENTRADA ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* ===== ANIMACIONES DE HOVER ===== */
@keyframes hoverScale {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

@keyframes hoverGlow {
  from {
    box-shadow: 0 0 0 rgba(0, 255, 136, 0);
  }
  to {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
  }
}

@keyframes hoverShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

@keyframes hoverBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ===== EFECTOS DE RIPPLE ===== */
.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::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;
}

.ripple-effect:active::before {
  width: 300px;
  height: 300px;
}

/* ===== EFECTOS DE WAVE ===== */
.wave-effect {
  position: relative;
  overflow: hidden;
}

.wave-effect::after {
  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.5s;
}

.wave-effect:hover::after {
  left: 100%;
}

/* ===== EFECTOS DE GLOW ===== */
.glow-effect {
  position: relative;
}

.glow-effect::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #00ff88, #4ecdc4, #ff6b35, #feca57);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.glow-effect:hover::before {
  opacity: 1;
  animation: glowRotate 2s linear infinite;
}

@keyframes glowRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== EFECTOS DE TILT 3D ===== */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt-3d:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg) scale3d(1.05, 1.05, 1.05);
}

/* ===== EFECTOS DE MORPHING ===== */
.morph-effect {
  position: relative;
  overflow: hidden;
}

.morph-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: all 0.3s ease;
  transform: scale(0);
  border-radius: 50%;
}

.morph-effect:hover::before {
  opacity: 1;
  transform: scale(1);
  border-radius: 0;
}

.morph-effect:hover {
  color: var(--bg-primary);
  z-index: 1;
  position: relative;
}

/* ===== EFECTOS DE PARTÍCULAS ===== */
.particle-effect {
  position: relative;
  overflow: hidden;
}

.particle-effect::before,
.particle-effect::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 3s infinite;
}

.particle-effect::before {
  top: 20%;
  left: 20%;
  animation-delay: 0s;
}

.particle-effect::after {
  top: 60%;
  right: 20%;
  animation-delay: 1.5s;
}

@keyframes particleFloat {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
}

/* ===== EFECTOS DE SCROLL REVEAL ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s var(--ease-out-expo);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s var(--ease-out-expo);
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s var(--ease-out-expo);
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ===== EFECTOS DE LOADING ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
  40%, 43% { transform: translateY(-30px); }
  70% { transform: translateY(-15px); }
  90% { transform: translateY(-4px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes wobble {
  0% { transform: translateX(0%); }
  15% { transform: translateX(-25%) rotate(-5deg); }
  30% { transform: translateX(20%) rotate(3deg); }
  45% { transform: translateX(-15%) rotate(-3deg); }
  60% { transform: translateX(10%) rotate(2deg); }
  75% { transform: translateX(-5%) rotate(-1deg); }
  100% { transform: translateX(0%); }
}

/* ===== EFECTOS DE TEXTO ===== */
@keyframes textShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.text-shimmer {
  background: linear-gradient(90deg, #00ff88, #4ecdc4, #ff6b35, #00ff88);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 3s linear infinite;
}

@keyframes textGlitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

.text-glitch {
  animation: textGlitch 0.3s infinite;
}

/* ===== EFECTOS DE BOTÓN ===== */
.btn-magnetic {
  position: relative;
  transition: transform 0.3s var(--ease-out-expo);
}

.btn-magnetic:hover {
  transform: translateY(-2px) scale(1.05);
}

.btn-magnetic:active {
  transform: translateY(0) scale(0.98);
}

.btn-liquid {
  position: relative;
  overflow: hidden;
  background: var(--gradient-primary);
  border: none;
  color: var(--bg-primary);
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-liquid::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-liquid:hover::before {
  left: 100%;
}

.btn-liquid:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 255, 136, 0.3);
}

/* ===== EFECTOS DE CARD ===== */
.card-floating {
  transition: all 0.3s var(--ease-out-expo);
}

.card-floating:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.card-3d:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.card-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.card-glass:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(0, 255, 136, 0.3);
  transform: translateY(-5px);
}

/* ===== EFECTOS DE NAVEGACIÓN ===== */
.nav-link-animated {
  position: relative;
  overflow: hidden;
}

.nav-link-animated::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link-animated:hover::before {
  width: 100%;
}

.nav-link-animated.active::before {
  width: 100%;
}

/* ===== EFECTOS DE FORMULARIO ===== */
.form-input-animated {
  position: relative;
  transition: all 0.3s ease;
}

.form-input-animated:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-label-animated {
  position: relative;
  transition: all 0.3s ease;
}

.form-label-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.form-input-animated:focus + .form-label-animated::after {
  width: 100%;
}

/* ===== EFECTOS DE NOTIFICACIÓN ===== */
.notification-slide-in {
  animation: slideInRight 0.5s var(--ease-out-expo);
}

.notification-slide-out {
  animation: slideOutRight 0.3s var(--ease-in-out-circ);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ===== EFECTOS DE MODAL ===== */
.modal-backdrop {
  animation: fadeIn 0.3s ease;
}

.modal-content {
  animation: scaleIn 0.3s var(--ease-out-back);
}

.modal-content.closing {
  animation: scaleOut 0.2s var(--ease-in-out-circ);
}

@keyframes scaleOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.8);
    opacity: 0;
  }
}

/* ===== EFECTOS DE PROGRESS BAR ===== */
.progress-bar-animated {
  position: relative;
  overflow: hidden;
}

.progress-bar-animated::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ===== EFECTOS DE TOGGLE ===== */
.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--bg-tertiary);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch.active {
  background: var(--primary-color);
}

.toggle-switch.active::before {
  transform: translateX(30px);
}

/* ===== EFECTOS DE DROPDOWN ===== */
.dropdown-menu {
  animation: slideDown 0.3s var(--ease-out-expo);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== EFECTOS DE TOOLTIP ===== */
.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

/* ===== EFECTOS DE SCROLL INDICATOR ===== */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 1000;
  transition: width 0.3s ease;
}

/* ===== EFECTOS DE CURSOR PERSONALIZADO ===== */
.cursor-pointer {
  cursor: pointer;
}

.cursor-grab {
  cursor: grab;
}

.cursor-grabbing {
  cursor: grabbing;
}

.cursor-zoom-in {
  cursor: zoom-in;
}

.cursor-zoom-out {
  cursor: zoom-out;
}

/* ===== EFECTOS DE RESPONSIVE ===== */
@media (max-width: 768px) {
  .tilt-3d:hover {
    transform: none;
  }
  
  .card-3d:hover {
    transform: none;
  }
  
  .btn-magnetic:hover {
    transform: none;
  }
  
  .card-floating:hover {
    transform: none;
  }
}

/* ===== EFECTOS DE ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== EFECTOS DE PERFORMANCE ===== */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.smooth-scroll {
  scroll-behavior: smooth;
}

/* ===== EFECTOS DE DEBUG ===== */
.debug-animation {
  outline: 2px solid red;
  outline-offset: 2px;
}

.debug-animation::before {
  content: 'ANIMATION';
  position: absolute;
  top: -20px;
  left: 0;
  background: red;
  color: white;
  padding: 2px 6px;
  font-size: 10px;
  z-index: 1000;
}

