/* Flight Card Styles */

/* Smooth transitions for flight card interactions */
.flight-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced hover effects */
.flight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Options panel animation */
.flight-options-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.flight-options-panel.expanded {
  max-height: 500px;
  opacity: 1;
}

/* Modal animations */
.modal-backdrop {
  transition: opacity 0.3s ease-out;
}

.modal-content {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(0.95);
  opacity: 0;
}

.modal-content.show {
  transform: scale(1);
  opacity: 1;
}

/* Button hover effects */
.flight-action-button {
  transition: all 0.2s ease-in-out;
}

.flight-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Flight path animation */
.flight-path-line {
  position: relative;
  overflow: hidden;
}

.flight-path-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  animation: flight-path-pulse 3s ease-in-out infinite;
}

@keyframes flight-path-pulse {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Airline logo placeholder styling */
.airline-logo-placeholder {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.75rem;
}

/* Price highlight animation */
.price-highlight {
  animation: price-pulse 2s ease-in-out infinite;
}

@keyframes price-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .flight-card {
    margin: 0 -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .flight-card:first-child {
    border-top: none;
    margin-top: -1rem;
  }
  
  .flight-options-panel.expanded {
    max-height: 600px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .flight-card {
    border-width: 2px;
    border-color: #000;
  }
  
  .flight-status-badge {
    border: 1px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .flight-card,
  .flight-options-panel,
  .modal-backdrop,
  .modal-content,
  .flight-action-button {
    transition: none;
  }
  
  .flight-path-line::before {
    animation: none;
  }
  
  .price-highlight {
    animation: none;
  }
}

/* Focus styles for accessibility */
.flight-card:focus-within {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Loading state */
.flight-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.flight-card.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .flight-card:hover {
    transform: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  }
  
  .flight-action-button:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
  .flight-card {
    background-color: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }
  
  .modal-content {
    background-color: #1f2937;
    color: #f9fafb;
  }
}