/* Blood Bank Application - Enhanced Animations CSS */

/* ===== ENTRANCE ANIMATIONS ===== */

/* Fade In Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.7s cubic-bezier(0.39, 0.575, 0.565, 1) forwards;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

/* Fade In Down Animation */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-down {
  animation: fadeInDown 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-left {
  animation: fadeInLeft 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

/* Fade In Right Animation */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-right {
  animation: fadeInRight 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

/* Zoom In Animation */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.zoom-in {
  animation: zoomIn 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) forwards;
}

/* Staggered children animations with enhanced timing */
.stagger-children > * {
  opacity: 0;
}

.stagger-children > *:nth-child(1) { animation: fadeInUp 0.7s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1s forwards; }
.stagger-children > *:nth-child(2) { animation: fadeInUp 0.7s cubic-bezier(0.215, 0.61, 0.355, 1) 0.25s forwards; }
.stagger-children > *:nth-child(3) { animation: fadeInUp 0.7s cubic-bezier(0.215, 0.61, 0.355, 1) 0.4s forwards; }
.stagger-children > *:nth-child(4) { animation: fadeInUp 0.7s cubic-bezier(0.215, 0.61, 0.355, 1) 0.55s forwards; }
.stagger-children > *:nth-child(5) { animation: fadeInUp 0.7s cubic-bezier(0.215, 0.61, 0.355, 1) 0.7s forwards; }

/* ===== ATTENTION ANIMATIONS ===== */

/* Pulse Animation - Enhanced */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

/* Heartbeat Animation - Enhanced */
@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

.heartbeat {
  animation: heartbeat 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  transform-origin: center;
}

/* Floating Animation */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Wobble Animation */
@keyframes wobble {
  0%, 100% { transform: translateX(0%); }
  15% { transform: translateX(-15%) rotate(-5deg); }
  30% { transform: translateX(10%) rotate(3deg); }
  45% { transform: translateX(-10%) rotate(-3deg); }
  60% { transform: translateX(5%) rotate(2deg); }
  75% { transform: translateX(-5%) rotate(-1deg); }
}

.wobble {
  animation: wobble 1.5s ease-in-out;
}

/* ===== BLOOD-THEMED ANIMATIONS ===== */

/* Blood Drip Animation - Enhanced */
@keyframes drip {
  0% { transform: translateY(-10px) scale(0.8); opacity: 0; }
  20% { opacity: 1; transform: translateY(10px) scale(1); }
  80% { opacity: 1; }
  100% { transform: translateY(100px) scale(0.9); opacity: 0; }
}

.blood-drip {
  animation: drip 2.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.2));
}

/* Blood Pulse Animation */
@keyframes bloodPulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.2) drop-shadow(0 0 5px rgba(231, 76, 60, 0.7)); }
  100% { transform: scale(1); filter: brightness(1); }
}

.blood-pulse {
  animation: bloodPulse 2s ease-in-out infinite;
}

/* Blood Flow Animation */
@keyframes bloodFlow {
  0% { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

.blood-flow {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: bloodFlow 5s linear forwards;
}

/* ===== UTILITY ANIMATIONS ===== */

/* Rotate Animation - Enhanced */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotate {
  animation: rotate 2s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
}

/* Slide In Animation - Enhanced */
@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slide-in {
  animation: slideIn 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Slide Out Animation */
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.slide-out {
  animation: slideOut 0.7s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

/* Shake Animation (for error states) - Enhanced */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-7px); }
  20%, 40%, 60%, 80% { transform: translateX(7px); }
}

.shake {
  animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  transform-origin: center;
}

/* Loading Spinner - Enhanced */
@keyframes spin {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); border-width: 5px; }
  100% { transform: rotate(360deg); }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(231, 76, 60, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  filter: drop-shadow(0 0 5px rgba(231, 76, 60, 0.3));
}

/* ===== INTERACTIVE EFFECTS ===== */

/* Button Hover Effect - Enhanced */
.btn-hover-effect {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.btn-hover-effect:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

.btn-hover-effect:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-hover-effect:hover:before {
  width: 300%;
  height: 300%;
}

.btn-hover-effect:active {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* Card Hover Effect - Enhanced */
.card-hover-effect {
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 1;
}

.card-hover-effect:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(52, 152, 219, 0.1) 100%);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s ease;
  border-radius: inherit;
}

.card-hover-effect:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-hover-effect:hover:after {
  opacity: 1;
}

/* Text Reveal Animation */
@keyframes textReveal {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

.text-reveal {
  animation: textReveal 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* Gradient Animation */
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-flow {
  background: linear-gradient(270deg, var(--primary-color), var(--secondary-color), var(--primary-dark));
  background-size: 200% 200%;
  animation: gradientFlow 5s ease infinite;
}