/* Custom styles for the Blood Donation Platform */

/* Enhanced scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

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

/* Mark animated elements to prevent re-animations */
.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Continuous animation for "every 2 seconds" card */
.every-2-seconds-card {
  animation: pulseEvery2Seconds 2s infinite;
}

@keyframes pulseEvery2Seconds {
  0%, 100% { 
    opacity: 1;
    transform: translateY(0);
  }
  50% { 
    opacity: 0.7;
    transform: translateY(-5px);
  }
}

/* Periodic highlight for important cards */
.periodic-highlight {
  animation: highlightPeriodically 4s infinite;
}

@keyframes highlightPeriodically {
  0%, 90%, 100% { 
    box-shadow: none;
  }
  5%, 10% { 
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5);
  }
}

/* Gradient animations */
.gradient-hover {
  background-size: 200% 200%;
  transition: all 0.3s ease;
}

.gradient-hover:hover {
  background-position: 100% 100%;
}

/* Pulse animation for important elements */
.pulse-animation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Floating animation for hero elements */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Parallax effect */
.parallax-element {
  transform: translateZ(0) translateY(0);
  transition: transform 0.1s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #ef4444, #dc2626);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #dc2626, #b91c1c);
}

/* Form input animations */
.input-field {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.input-field:focus-within {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* Button animations */
.btn-animated {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.btn-animated:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
  transform: perspective(1000px);
}

.card-hover:hover {
  transform: translateY(-5px) rotateX(5deg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Backdrop blur enhancements - DISABLED for better text clarity */
/* .backdrop-blur-lg {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
} */

/* Custom transitions */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

/* Loading animations */
.loading-spinner {
  animation: spin 1s linear infinite;
}

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

/* Text gradient animations */
.text-gradient-animated {
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 8s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

/* Wave animation for background elements */
.wave-animation {
  animation: wave 10s linear infinite;
  transform-origin: center;
}

@keyframes wave {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(5deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Dynamic color transitions */
.color-transition {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

/* Smooth scrolling enhancement */
html {
  scroll-behavior: smooth;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
  }
}