/* Loading Animation for Flight Search */
.flight-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.flight-loading-animation {
  position: relative;
  width: 300px;
  height: 150px;
  margin-bottom: 2rem;
}

/* Cloud background */
.loading-clouds {
  position: absolute;
  width: 100%;
  height: 100%;
}

.loading-cloud {
  position: absolute;
  background: white;
  border-radius: 50px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  opacity: 0.8;
  animation: cloudFloat 3s ease-in-out infinite;
}

.loading-cloud:nth-child(1) {
  width: 60px;
  height: 20px;
  top: 40px;
  left: 20px;
  animation-delay: 0s;
}

.loading-cloud:nth-child(2) {
  width: 80px;
  height: 25px;
  top: 60px;
  right: 40px;
  animation-delay: 0.5s;
}

.loading-cloud:nth-child(3) {
  width: 50px;
  height: 18px;
  bottom: 50px;
  left: 80px;
  animation-delay: 1s;
}

/* Flying plane */
.loading-plane {
  position: absolute;
  width: 40px;
  height: 40px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  animation: planeFly 2.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

/* Ensure inline SVG renders reliably across browsers */
.loading-plane svg {
  display: block;
  width: 40px;
  height: 40px;
}

.plane-body {
  fill: #007bff;
  animation: planeWobble 1s ease-in-out infinite;
}

.plane-wing {
  fill: #0056b3;
}

.plane-tail {
  fill: #003d7a;
}

.plane-window {
  fill: white;
}

/* Flight path */
.flight-path {
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #007bff, transparent);
  animation: pathGlow 2s ease-in-out infinite;
}

/* Loading dots */
.loading-dots {
  display: flex;
  gap: 8px;
  margin: 1.5rem 0;
}

.loading-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #007bff;
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Loading text */
.loading-text {
  margin-top: 1.5rem;
  color: #495057;
  font-size: 1.1rem;
  font-weight: 500;
}

.loading-subtext {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  max-width: 400px;
}

/* Loading progress bar */
.loading-progress {
  width: 100%;
  max-width: 300px;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #00d4ff);
  border-radius: 3px;
  animation: progressFill 2s ease-in-out infinite;
  width: 30%;
}

/* Featured flights specific loading */
.featured-loading {
  background: transparent;
  padding: 2rem;
}

/* Animations */
@keyframes planeFly {
  0% {
    left: 0;
    transform: translateY(-50%) rotate(0deg);
  }
  25% {
    transform: translateY(-55%) rotate(5deg);
  }
  50% {
    transform: translateY(-50%) rotate(0deg);
  }
  75% {
    transform: translateY(-45%) rotate(-5deg);
  }
  100% {
    left: 260px;
    transform: translateY(-50%) rotate(0deg);
  }
}

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

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

@keyframes pathGlow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@keyframes dotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes progressFill {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .flight-loading-container {
    padding: 2rem 1rem;
  }
  
  .flight-loading-animation {
    width: 250px;
    height: 120px;
  }
  
  @keyframes planeFly {
    100% {
      left: 210px;
    }
  }
}

@media (max-width: 480px) {
  .flight-loading-animation {
    width: 200px;
    height: 100px;
  }
  
  .loading-text {
    font-size: 1rem;
  }
  
  @keyframes planeFly {
    100% {
      left: 160px;
    }
  }
}
