/* assets/css/animations.css — Animaciones Modernas TraumaWeb v3.0 */

/* ══════════════════════════════════════════════
   1. TRANSICIONES Y REVEALS DE SECCIÓN
══════════════════════════════════════════════ */
@keyframes sectionEnterGlow {
  0% {
    opacity: 0.85;
    background-color: rgba(37, 99, 235, 0.08);
  }
  100% {
    opacity: 1;
    background-color: transparent;
  }
}

.section-highlight {
  animation: sectionEnterGlow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scroll reveal con stagger */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }

/* ══════════════════════════════════════════════
   2. HOLOGRAMA MÉDICO Y EFECTO DE ESCÁNER LÁSER
══════════════════════════════════════════════ */
@keyframes holoRotateClockwise {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes holoRotateCounter {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

@keyframes laserScannerVertical {
  0% {
    top: 0%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 96%;
    opacity: 0;
  }
}

@keyframes hologramPulse {
  0%, 100% {
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.45));
    transform: translateY(0px) scale(1);
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(56, 189, 248, 0.8));
    transform: translateY(-8px) scale(1.02);
  }
}

.hologram-stage {
  position: relative;
  width: 380px;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.hologram-ring-outer {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1.5px dashed rgba(56, 189, 248, 0.35);
  animation: holoRotateClockwise 25s linear infinite;
  pointer-events: none;
}

.hologram-ring-inner {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px dotted rgba(96, 165, 250, 0.4);
  animation: holoRotateCounter 18s linear infinite;
  pointer-events: none;
}

.hologram-laser-bar {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38BDF8, #60A5FA, #38BDF8, transparent);
  box-shadow: 0 0 16px #38BDF8, 0 0 30px #60A5FA;
  animation: laserScannerVertical 3.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 5;
}

.hologram-body-avatar {
  position: relative;
  z-index: 2;
  animation: hologramPulse 4s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* ══════════════════════════════════════════════
   3. ANIMACIÓN DEL NAVBAR Y SLIDER ACTIVO
══════════════════════════════════════════ */
.navbar-nav {
  position: relative;
}

.nav-indicator-pill {
  position: absolute;
  height: 36px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 50px;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 0;
  display: none;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.nav-link-tw {
  position: relative;
  z-index: 1;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav-link-tw:hover {
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   4. EFECTO 3D TILT EN TARJETAS
══════════════════════════════════════════ */
.tilt-card {
  transition: transform 0.15s ease-out, box-shadow 0.25s ease;
  will-change: transform;
  transform-style: preserve-3d;
}

.tilt-card:hover {
  box-shadow: 0 20px 40px -10px rgba(30, 64, 175, 0.18);
}

/* Brillo que recorre botones (Shimmer Sweep) */
@keyframes buttonShimmer {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(250%) rotate(45deg);
  }
}

.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 20%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 80%
  );
  transform: translateX(-100%) rotate(45deg);
  pointer-events: none;
}

.btn-shimmer:hover::after {
  animation: buttonShimmer 1s ease-in-out;
}

/* ══════════════════════════════════════════════
   5. CONTADORES CON EFECTO POP
══════════════════════════════════════════ */
@keyframes numberPop {
  0% { transform: scale(0.85); opacity: 0.4; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.number-popped {
  animation: numberPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Floating badge en hero */
@keyframes floatGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.floating-badge-1 {
  animation: floatGentle 4s ease-in-out infinite;
}

.floating-badge-2 {
  animation: floatGentle 4.5s ease-in-out infinite 0.7s;
}

/* ══════════════════════════════════════════════
   6. OPTIMIZACIÓN Y EFECTOS PARA MÓVILES
══════════════════════════════════════════════ */
@media (max-width: 991px) {
  .hologram-stage {
    width: 300px;
    height: 380px;
    margin: 0 auto;
  }
  .hologram-ring-outer {
    width: 290px;
    height: 290px;
  }
  .hologram-ring-inner {
    width: 240px;
    height: 240px;
  }
  .hologram-body-avatar svg {
    width: 170px;
    height: 290px;
  }
  .floating-badge-1 {
    top: 2% !important;
    right: -2% !important;
    font-size: 11px !important;
    padding: 6px 12px !important;
  }
  .floating-badge-2 {
    bottom: 5% !important;
    left: -2% !important;
    font-size: 11px !important;
    padding: 6px 12px !important;
  }
  .body-pin {
    width: 36px !important;
    height: 36px !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35) !important;
  }
  .body-pin .pin-dot {
    width: 12px !important;
    height: 12px !important;
  }
}
