/* =========================================================
   DengueCare - Animaciones
   ========================================================= */

/* --- Partículas decorativas del Hero --- */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0;
}

.p1 { width: 3px; height: 3px; background: var(--color-accent); top: 20%; left: 15%; animation-duration: 8s; animation-delay: 0s; }
.p2 { width: 2px; height: 2px; background: var(--color-accent-dark); top: 60%; left: 80%; animation-duration: 10s; animation-delay: 2s; }
.p3 { width: 4px; height: 4px; background: var(--color-accent); top: 40%; left: 60%; animation-duration: 12s; animation-delay: 1s; }
.p4 { width: 2px; height: 2px; background: rgba(192,24,42,0.5); top: 75%; left: 25%; animation-duration: 9s; animation-delay: 3s; }
.p5 { width: 3px; height: 3px; background: var(--color-accent-dark); top: 15%; left: 75%; animation-duration: 11s; animation-delay: 0.5s; }
.p6 { width: 2px; height: 2px; background: var(--color-accent); top: 85%; left: 50%; animation-duration: 7s; animation-delay: 4s; }

@keyframes float {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  10% { opacity: 1; transform: scale(1); }
  90% { opacity: 1; }
  100% { transform: translateY(-120px) scale(0.5); opacity: 0; }
}

/* --- Transición entre secciones --- */
.section-transition {
  animation: sectionEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes sectionEnter {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Loader de carga --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 24px;
  letter-spacing: -0.04em;
}

.loading-logo span { color: var(--color-accent); }

.loading-bar-wrapper {
  width: 200px;
  height: 2px;
  background: var(--color-surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #8f0f1e);
  animation: loadingProgress 1.2s ease forwards;
}

@keyframes loadingProgress {
  from { width: 0%; }
  to { width: 100%; }
}

/* --- Efecto de halo en hover sobre tarjetas --- */
.profile-card .halo {
  position: absolute;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translate(-50%, -50%);
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
}

.medical .halo { background: radial-gradient(circle, rgba(192,24,42,0.12) 0%, transparent 70%); }
.patient .halo { background: radial-gradient(circle, rgba(143,15,30,0.10) 0%, transparent 70%); }

.profile-card:hover .halo { opacity: 1; }

/* --- Animación del semáforo de resultado --- */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px currentColor; }
  50% { box-shadow: 0 0 50px currentColor; }
}

.result-hero.green { animation: resultFadeIn 0.6s ease both; }
.result-hero.yellow { animation: resultFadeIn 0.6s ease both; }
.result-hero.red { animation: resultFadeIn 0.6s ease both; }

@keyframes resultFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Shake para error / selección obligatoria --- */
.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* --- Stagger para listas en resultado --- */
.result-list li {
  animation: fadeInLeft 0.4s ease both;
}

.result-list li:nth-child(1) { animation-delay: 0.1s; }
.result-list li:nth-child(2) { animation-delay: 0.15s; }
.result-list li:nth-child(3) { animation-delay: 0.2s; }
.result-list li:nth-child(4) { animation-delay: 0.25s; }
.result-list li:nth-child(5) { animation-delay: 0.3s; }
.result-list li:nth-child(6) { animation-delay: 0.35s; }
.result-list li:nth-child(7) { animation-delay: 0.4s; }
.result-list li:nth-child(8) { animation-delay: 0.45s; }

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Indicador de paso activo en progress --- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-surface-3);
  transition: all 0.3s ease;
}

.step-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--color-accent);
}

.step-dot.done { background: var(--color-green); }

/* --- Urgency badge --- */
.urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 30px;
  margin-bottom: 16px;
}

.urgency-badge.urgent {
  background: var(--color-red-bg);
  border: 1px solid var(--color-red-border);
  color: var(--color-red);
}

.urgency-badge.urgent::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-red);
  border-radius: 50%;
  animation: pulse 1s ease infinite;
}

.urgency-badge.watch {
  background: var(--color-yellow-bg);
  border: 1px solid var(--color-yellow-border);
  color: var(--color-yellow);
}

.urgency-badge.safe {
  background: var(--color-green-bg);
  border: 1px solid var(--color-green-border);
  color: var(--color-green);
}
