/* ============================================================
   CLINICPEER — ANIMATIONS & KEYFRAMES
   ============================================================ */

/* ── Keyframes ─────────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@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.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes ripple {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

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

@keyframes particleFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  50%  { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

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

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.15); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.1); }
  70%       { transform: scale(1); }
}

@keyframes slideInNav {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40%           { transform: scale(1); }
}

@keyframes waveform {
  0%   { height: 4px; }
  50%  { height: 20px; }
  100% { height: 4px; }
}

@keyframes progressFill {
  from { width: 0%; }
  to   { width: var(--progress-width, 75%); }
}

/* ── Animation Utility Classes ─────────────────────────────── */

.animate-fade-in      { animation: fadeIn var(--trans-base) var(--ease) both; }
.animate-fade-in-up   { animation: fadeInUp 0.6s var(--ease) both; }
.animate-fade-in-down { animation: fadeInDown 0.6s var(--ease) both; }
.animate-fade-in-left { animation: fadeInLeft 0.6s var(--ease) both; }
.animate-scale-in     { animation: scaleIn 0.5s var(--ease) both; }
.animate-float        { animation: float 3.5s ease-in-out infinite; }
.animate-pulse        { animation: pulse 2s ease-in-out infinite; }
.animate-spin         { animation: spin 1s linear infinite; }
.animate-heartbeat    { animation: heartbeat 1.5s ease-in-out infinite; }

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ── Scroll-triggered Reveal ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* ── Particle Background ───────────────────────────────────── */
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.particle {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  animation: particleFloat linear infinite;
}

/* ── Loader / Spinner ──────────────────────────────────────── */
.loader {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-dots span {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin: 0 3px;
}
.loading-dots span:nth-child(1) { animation: dotBounce 1.4s ease-in-out 0s infinite; }
.loading-dots span:nth-child(2) { animation: dotBounce 1.4s ease-in-out 0.16s infinite; }
.loading-dots span:nth-child(3) { animation: dotBounce 1.4s ease-in-out 0.32s infinite; }

/* ── Shimmer Skeleton ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  animation: progressFill 1.2s var(--ease) forwards;
}

/* ── Ripple Button Effect ──────────────────────────────────── */
.ripple-btn { position: relative; overflow: hidden; }
.ripple-btn .ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ── Gradient Text ─────────────────────────────────────────── */
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Hover Lift ────────────────────────────────────────────── */
.hover-lift { transition: transform var(--trans-base), box-shadow var(--trans-base); }
.hover-lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }

/* ── Notification Toast ────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 90px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-xl);
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid var(--primary);
  animation: slideUp 0.4s var(--ease) both;
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error   { border-left-color: var(--danger); }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-message { flex: 1; font-weight: 500; font-size: 0.9rem; }
.toast-close { font-size: 1.1rem; color: var(--gray-500); cursor: pointer; transition: color var(--trans-fast); }
.toast-close:hover { color: var(--danger); }
