/* Advanced Animations and Effects */

/* Breathing Effect for Hero Elements */
@keyframes breathe {
  0%, 100% { 
    transform: scale(1); 
    opacity: 1; 
  }
  50% { 
    transform: scale(1.02); 
    opacity: 0.95; 
  }
}

.logo-container {
  animation: breathe 4s ease-in-out infinite;
}

/* Gradient Animation for Accent Text */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.title-line.accent {
  animation: gradientShift 3s ease infinite;
}

/* Floating Animation for Background Elements */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(-10px) rotate(-1deg); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(2deg); }
}

@keyframes floatReverse {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(15px) rotate(-1deg); }
  66% { transform: translateY(5px) rotate(1deg); }
}

/* Floating Medical Icons */
.floating-icon {
  position: absolute;
  opacity: 0.1;
  color: var(--primary-blue);
  pointer-events: none;
  will-change: transform;
}

.floating-icon.icon-1 {
  top: 15%;
  left: 10%;
  animation: float 6s ease-in-out infinite;
  animation-delay: 0s;
}

.floating-icon.icon-2 {
  top: 25%;
  right: 15%;
  animation: floatSlow 8s ease-in-out infinite;
  animation-delay: 1s;
}

.floating-icon.icon-3 {
  bottom: 30%;
  left: 20%;
  animation: floatReverse 7s ease-in-out infinite;
  animation-delay: 2s;
}

.floating-icon.icon-4 {
  bottom: 20%;
  right: 10%;
  animation: float 5s ease-in-out infinite;
  animation-delay: 3s;
}

.floating-icon.icon-5 {
  top: 50%;
  left: 5%;
  animation: floatSlow 9s ease-in-out infinite;
  animation-delay: 4s;
}

.floating-icon.icon-6 {
  top: 60%;
  right: 5%;
  animation: floatReverse 6s ease-in-out infinite;
  animation-delay: 5s;
}

/* Particle Animations */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-blue);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

.particle.active {
  animation: particleLife 3s ease-out forwards;
}

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

/* Mouse Trail Effect */
.mouse-trail {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-blue);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

.mouse-trail.active {
  animation: trailFade 1s ease-out forwards;
}

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

/* Loading States */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

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

/* Hover Effects Enhancement */
.feature-item {
  position: relative;
  overflow: hidden;
}

.feature-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
  transition: left 0.5s ease;
}

.feature-item:hover::before {
  left: 100%;
}

/* Staggered Animation for Features */
.feature-item:nth-child(1) {
  animation: slideInUp 0.6s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
  transform: translateY(30px);
}

.feature-item:nth-child(2) {
  animation: slideInUp 0.6s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
  transform: translateY(30px);
}

.feature-item:nth-child(3) {
  animation: slideInUp 0.6s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Text Animation */
.hero-title .title-line {
  opacity: 0;
  transform: translateY(50px);
  animation: titleReveal 0.8s ease forwards;
}

.hero-title .title-line:nth-child(1) {
  animation-delay: 0.2s;
}

.hero-title .title-line:nth-child(2) {
  animation-delay: 0.4s;
}

@keyframes titleReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-description {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Animation */
.email-signup-form {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.8s;
}


/* Social Links Animation */
.social-link {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.social-link:nth-child(1) { animation-delay: 1.2s; }
.social-link:nth-child(2) { animation-delay: 1.3s; }
.social-link:nth-child(3) { animation-delay: 1.4s; }

/* Magnetic Effect for Buttons */
.submit-button {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}

.submit-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--primary-blue-light), var(--primary-blue-dark));
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

.submit-button:hover::before {
  opacity: 1;
}

/* Success/Error Animation for Form */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-20px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(0);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.form-message.show {
  animation: bounceIn 0.6s ease forwards;
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .floating-icon {
    display: none;
  }
  
  .particle-container {
    display: none;
  }
}

/* Background Gradient Animation */
.gradient-overlay {
  background: linear-gradient(
    135deg,
    #f9fafb 0%,
    #ffffff 25%,
    #f3f4f6 50%,
    #ffffff 75%,
    #f9fafb 100%
  );
  background-size: 400% 400%;
  animation: gradientMove 15s ease infinite;
}

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

/* Logo Icon Rotation Effect */
.logo-icon svg {
  transition: transform var(--transition-slow);
}

.logo-container:hover .logo-icon svg {
  transform: rotate(10deg);
}

/* Interactive Elements Glow Effect */
.input-container:focus-within {
  position: relative;
}

.input-container:focus-within::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary-blue), var(--accent-purple));
  border-radius: inherit;
  z-index: -1;
  opacity: 0.7;
  filter: blur(8px);
  animation: glowPulse 2s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from {
    filter: blur(8px);
  }
  to {
    filter: blur(12px);
  }
}