/* Features Section Enhanced Animations */

/* CSS Variables for easy customization */
:root {
  --animation-duration: 1s;
  --primary-color: #e94e1b;
  --secondary-color: #4294c7;
  --success-color: #28a745;
  --info-color: #20c997;
  --purple-color: #6f42c1;
  --pink-color: #e83e8c;
}

/* Floating Particles Animation */
.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 50%;
  opacity: 0.1;
  animation: particleFloat 15s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(233, 78, 27, 0.3);
}

.particle-1 {
  width: 20px;
  height: 20px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.particle-2 {
  width: 15px;
  height: 15px;
  top: 20%;
  right: 15%;
  animation-delay: -5s;
}

.particle-3 {
  width: 25px;
  height: 25px;
  bottom: 30%;
  left: 20%;
  animation-delay: -10s;
}

.particle-4 {
  width: 12px;
  height: 12px;
  top: 60%;
  right: 25%;
  animation-delay: -3s;
}

.particle-5 {
  width: 18px;
  height: 18px;
  bottom: 20%;
  right: 30%;
  animation-delay: -8s;
}

@keyframes particleFloat {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg) scale(1);
    opacity: 0.1;
  }
  25% {
    transform: translateY(-20px) rotate(90deg) scale(1.1);
    opacity: 0.15;
  }
  50% {
    transform: translateY(-30px) rotate(180deg) scale(0.9);
    opacity: 0.2;
  }
  75% {
    transform: translateY(-15px) rotate(270deg) scale(1.05);
    opacity: 0.15;
  }
}

/* Logo Animations */
.logo-container {
  position: relative;
  display: inline-block;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0px) scale(1);
    filter: drop-shadow(0 5px 15px rgba(233, 78, 27, 0.2));
  }
  50% {
    transform: translateY(-10px) scale(1.05);
    filter: drop-shadow(0 15px 25px rgba(233, 78, 27, 0.3));
  }
}

.logo-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  animation: ringPulse 2s ease-out infinite;
}

.ring-1 {
  width: 120px;
  height: 120px;
  animation-delay: 0s;
  border-color: var(--primary-color);
}

.ring-2 {
  width: 140px;
  height: 140px;
  animation-delay: 1s;
  border-color: var(--secondary-color);
}

@keyframes ringPulse {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.8);
    border-width: 3px;
  }
  50% {
    opacity: 0.4;
    border-width: 1px;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
    border-width: 0px;
  }
}

/* Title Animations */
.animated-title {
  animation: titleSlideIn 1s ease-out 0.5s both;
}

.animated-subtitle {
  animation: titleSlideIn 1s ease-out 0.8s both;
}

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

/* Animated Underline SVG */
.animated-underline {
  width: 100%;
  height: 20px;
  margin-top: 10px;
}

.underline-path {
  animation: drawLine 2s ease-out 1.2s both;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Feature Cards Animations */
.feature-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transform: translateY(0);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.feature-card:hover .animated-icon {
  transform: scale(1.1);
}

.feature-card:hover .bg-wave {
  animation-play-state: running;
}

/* Background Wave Animation */
.card-bg-animation {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 1;
}

.bg-wave {
  width: 100%;
  height: 100%;
  animation: waveRotate 20s linear infinite;
  animation-play-state: paused;
}

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

/* Icon Animations */
.animated-icon {
  transition: all 0.3s ease;
  position: relative;
  z-index: 3;
}

/* Play Icon Specific */
.play-icon .icon-path {
  animation: playPulse 2s ease-in-out infinite;
}

.play-icon .icon-ring {
  animation: ringScale 3s ease-in-out infinite;
}

@keyframes playPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes ringScale {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.6;
  }
}

/* Question Icon Specific */
.floating-q {
  animation: floatQuestion 3s ease-in-out infinite;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.floating-q-1 {
  animation-delay: 0s;
}

.floating-q-2 {
  animation-delay: 1.5s;
}

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

/* Phone Icon Specific */
.signal-wave {
  animation: signalPulse 2s ease-in-out infinite;
}

.wave-1 {
  animation-delay: 0s;
}

.wave-2 {
  animation-delay: 0.3s;
}

.wave-3 {
  animation-delay: 0.6s;
}

@keyframes signalPulse {
  0%,
  100% {
    opacity: 0.6;
    stroke-width: 1.5;
  }
  50% {
    opacity: 1;
    stroke-width: 2;
  }
}

/* Pulse Rings for All Icons */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  border-radius: 50%;
  opacity: 0;
  animation: pulsateRing 2s ease-out infinite;
}

.pulse-ring-1 {
  width: 90px;
  height: 90px;
  animation-delay: 0s;
}

.pulse-ring-2 {
  width: 110px;
  height: 110px;
  animation-delay: 1s;
}

@keyframes pulsateRing {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.3);
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .particle {
    width: 10px !important;
    height: 10px !important;
  }

  .logo-ring {
    width: 80px !important;
    height: 80px !important;
  }

  .ring-2 {
    width: 100px !important;
    height: 100px !important;
  }

  .feature-card {
    margin-bottom: 30px;
    transform: none !important; /* Disable transform on mobile for performance */
  }

  .feature-card:hover {
    transform: none !important;
  }

  .animated-underline {
    width: 80%;
  }

  .pulse-ring {
    display: none; /* Disable pulse rings on mobile */
  }
}

@media (max-width: 480px) {
  .floating-particles {
    display: none; /* Hide particles on very small screens */
  }

  .logo-ring {
    display: none; /* Hide logo rings on small screens */
  }

  .feature-card {
    padding: 20px !important;
  }

  .feature-icon {
    width: 60px !important;
    height: 60px !important;
  }

  .animated-icon {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Loading Animation for Feature Cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-card[data-aos="fade-up"] {
  animation: fadeInUp 0.8s ease-out both;
}

.feature-card[data-aos-delay="100"] {
  animation-delay: 0.1s;
}

.feature-card[data-aos-delay="200"] {
  animation-delay: 0.2s;
}

.feature-card[data-aos-delay="300"] {
  animation-delay: 0.3s;
}

/* Enhanced animation states */
.animate-in {
  animation-play-state: running !important;
}

.animate-in .animated-icon {
  animation: iconBounce 0.6s ease-out 0.3s both;
}

@keyframes iconBounce {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Hover Effects Enhancement */
.feature-card:hover .pulse-ring {
  animation-duration: 1s;
}

.feature-card:hover .wave-path {
  animation: waveRotate 10s linear infinite;
}

.feature-card:hover .animated-icon {
  animation-play-state: running;
}

/* Performance Optimization */
.animated-icon,
.bg-wave,
.pulse-ring,
.logo-ring,
.particle {
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .particle {
    background: #000;
    opacity: 0.2;
  }

  .logo-ring {
    border-color: #000;
  }

  :root {
    --primary-color: #000;
    --secondary-color: #666;
  }
}

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

  .floating-particles,
  .logo-ring,
  .pulse-ring {
    display: none;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .particle {
    background: linear-gradient(45deg, #ff6b35, #20c997);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
  }

  .feature-card {
    background: rgba(255, 255, 255, 0.05) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
}
