/* =====================================================
   MEJORAS DE MODERNIZACIÓN - AGREGADAS AL CSS EXISTENTE
   Agrega estas reglas DESPUÉS de tu CSS actual
   ===================================================== */

/* =====================================================
   1. GLASSMORPHISM PARA TARJETAS Y MODALES
   ===================================================== */

.project-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 90, 238, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 90, 238, 0.3);
  box-shadow: 
    0 20px 60px rgba(0, 90, 238, 0.2),
    0 10px 30px rgba(0, 0, 0, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 1);
}

/* =====================================================
   2. EFECTOS DE HOVER AVANZADOS CON MICROINTERACCIONES
   ===================================================== */

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:active {
  transform: scale(0.95);
}

/* =====================================================
   3. SOMBRAS DINÁMICAS EN ELEMENTOS PRINCIPALES
   ===================================================== */

.main-counter {
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 10px 40px rgba(0, 90, 238, 0.1),
    0 20px 80px rgba(0, 90, 238, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.main-counter:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 15px 50px rgba(0, 90, 238, 0.15),
    0 30px 100px rgba(0, 90, 238, 0.1);
}

/* =====================================================
   4. GRADIENTES ANIMADOS EN FONDOS
   ===================================================== */

.hero {
  background: linear-gradient(135deg, 
    #E6F0FF 0%, 
    #FFFFFF 30%,
    #FFF5E6 60%,
    #F0E6FF 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* =====================================================
   5. EFECTOS DE PARALLAX SUTILES
   ===================================================== */

.floating-icon {
  animation: floatParallax 8s ease-in-out infinite;
  will-change: transform;
}

@keyframes floatParallax {
  0%, 100% { 
    transform: translateY(0px) translateX(0px) rotate(0deg); 
  }
  25% { 
    transform: translateY(-20px) translateX(10px) rotate(5deg); 
  }
  50% { 
    transform: translateY(-10px) translateX(-10px) rotate(-3deg); 
  }
  75% { 
    transform: translateY(-25px) translateX(5px) rotate(3deg); 
  }
}

.floating-icon:nth-child(1) { animation-duration: 7s; }
.floating-icon:nth-child(2) { animation-duration: 9s; animation-delay: 1s; }
.floating-icon:nth-child(3) { animation-duration: 8s; animation-delay: 2s; }
.floating-icon:nth-child(4) { animation-duration: 10s; animation-delay: 1.5s; }

/* =====================================================
   6. BORDES ILUMINADOS (GLOW EFFECT)
   ===================================================== */

.amount-btn.selected {
  box-shadow: 
    0 0 20px rgba(0, 90, 238, 0.4),
    0 0 40px rgba(0, 90, 238, 0.2),
    0 8px 25px rgba(0, 90, 238, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 
      0 0 20px rgba(0, 90, 238, 0.4),
      0 0 40px rgba(0, 90, 238, 0.2),
      0 8px 25px rgba(0, 90, 238, 0.3),
      inset 0 0 20px rgba(255, 255, 255, 0.2);
  }
  50% { 
    box-shadow: 
      0 0 30px rgba(0, 90, 238, 0.6),
      0 0 60px rgba(0, 90, 238, 0.3),
      0 8px 35px rgba(0, 90, 238, 0.4),
      inset 0 0 30px rgba(255, 255, 255, 0.3);
  }
}

/* =====================================================
   7. TARJETAS CON EFECTO 3D
   ===================================================== */

.stat-card {
  transform-style: preserve-3d;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stat-card:hover {
  transform: translateY(-12px) rotateX(5deg) scale(1.03);
  box-shadow: 
    0 30px 90px rgba(0, 90, 238, 0.25),
    0 15px 50px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* =====================================================
   8. ANIMACIÓN DE PROGRESO MEJORADA
   ===================================================== */

.progress-fill {
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =====================================================
   9. TEXTO CON EFECTO GRADIENT ANIMADO
   ===================================================== */

.hero-title .highlight {
  background: linear-gradient(
    45deg,
    var(--primary-500),
    var(--accent-purple),
    var(--accent-orange),
    var(--primary-500)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-flow 4s ease infinite;
}

@keyframes gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* =====================================================
   10. MODAL CON ENTRADA DRAMÁTICA
   ===================================================== */

.modal {
  animation: modalBackdrop 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modalBackdrop {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
}

.modal-content {
  animation: modalEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEntrance {
  from {
    opacity: 0;
    transform: translate(-50%, -30px) scale(0.9) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0px) scale(1) rotateX(0deg);
  }
}

/* =====================================================
   11. CONTRIBUYENTES CON ANIMACIÓN DE APARICIÓN
   ===================================================== */

.contributor-card {
  animation: fadeInScale 0.6s ease-out backwards;
}

.contributor-card:nth-child(1) { animation-delay: 0.1s; }
.contributor-card:nth-child(2) { animation-delay: 0.2s; }
.contributor-card:nth-child(3) { animation-delay: 0.3s; }
.contributor-card:nth-child(4) { animation-delay: 0.4s; }
.contributor-card:nth-child(5) { animation-delay: 0.5s; }
.contributor-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =====================================================
   12. BARRA DE NAVEGACIÓN CON SOMBRA DINÁMICA
   ===================================================== */

.header {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0);
  transition: all 0.3s ease;
}

.header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

/* =====================================================
   13. ICONOS CON EFECTO DE PULSO
   ===================================================== */

.stat-icon {
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 4px 8px rgba(0, 90, 238, 0.2));
  }
  50% { 
    transform: scale(1.1);
    filter: drop-shadow(0 6px 12px rgba(0, 90, 238, 0.4));
  }
}

/* =====================================================
   14. TRANSICIONES SUAVES EN INPUTS
   ===================================================== */

input, textarea {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

input:focus, textarea:focus {
  transform: translateY(-2px);
  box-shadow: 
    0 0 0 3px rgba(0, 90, 238, 0.1),
    0 5px 15px rgba(0, 90, 238, 0.15);
}

/* =====================================================
   15. FOOTER CON GRADIENTE SUTIL
   ===================================================== */

.footer {
  background: linear-gradient(135deg, 
    #121217 0%, 
    #1a1a24 50%, 
    #121217 100%);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(0, 90, 238, 0.3), 
    transparent);
}

/* =====================================================
   16. TAGS CON EFECTO HOVER MEJORADO
   ===================================================== */

.tag {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: default;
}

.tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 90, 238, 0.2);
}

.tag.purple:hover { box-shadow: 0 4px 12px rgba(138, 63, 252, 0.3); }
.tag.orange:hover { box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3); }
.tag.green:hover { box-shadow: 0 4px 12px rgba(0, 167, 143, 0.3); }

/* =====================================================
   17. OPTIMIZACIONES DE RENDIMIENTO
   ===================================================== */

.project-card,
.stat-card,
.contributor-card,
.btn {
  will-change: transform;
}

/* Reducir animaciones en dispositivos con preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================
   18. MEJORAS RESPONSIVE CON ANIMACIONES
   ===================================================== */

@media (max-width: 768px) {
  .stat-card:hover {
    transform: translateY(-6px) scale(1.02);
  }
  
  .project-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

/* =====================================================
   19. CONTADOR CON EFECTO DE CONTEO ANIMADO
   ===================================================== */

.counter-amount {
  animation: countUpBounce 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

@keyframes countUpBounce {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.5);
  }
  50% {
    transform: translateY(-10px) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =====================================================
   20. SOCIAL SHARING CON MICRO-ANIMACIONES
   ===================================================== */

.social-btn {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-btn:hover {
  transform: translateY(-5px) scale(1.1) rotate(5deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.social-btn:active {
  transform: translateY(-2px) scale(1.05);
}