/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import "tailwindcss";
@import "flight_cards";

/* Trip Type Selection Styles */
.trip-type-option.active {
  background-color: #0ea5e9;
  border-color: #0ea5e9;
  color: white;
  box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.1), 0 4px 6px -2px rgba(14, 165, 233, 0.05);
}

/* Passenger Selector Styles */
.passenger-selector-button:focus {
  outline: none;
  ring: 2px;
  ring-color: #0ea5e9;
  border-color: #0ea5e9;
}

.passenger-counter-btn {
  transition: all 0.15s ease-in-out;
}

.passenger-counter-btn:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #0ea5e9;
}

.passenger-counter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Compact Form Styles */
.flight-search-form {
  line-height: 1.4;
}

.flight-search-form input,
.flight-search-form select {
  font-size: 0.95rem;
}

.flight-search-form label {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* Optimize dropdown spacing */
.passenger-selector-dropdown {
  min-width: 280px;
}

/* Ensure proper form density */
.form-section {
  margin-bottom: 1rem;
}

/* Autocomplete Styles */
.autocomplete-result {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.15s ease-in-out;
}

.autocomplete-result:hover,
.autocomplete-result.selected {
  background-color: #f9fafb;
}

.autocomplete-result:last-child {
  border-bottom: none;
}

.autocomplete-result:hover .text-gray-500,
.autocomplete-result.selected .text-gray-500 {
  color: #6b7280;
}

/* Loading state for autocomplete */
.autocomplete-loading {
  padding: 0.75rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

/* No results state */
.autocomplete-no-results {
  padding: 0.75rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  font-style: italic;
}

/* Autocomplete dropdown positioning */
.autocomplete-dropdown {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: white;
  z-index: 50;
}

/* Ensure autocomplete works well with form focus states */
.autocomplete-input:focus + .autocomplete-dropdown {
  border-color: #3b82f6;
}

/* Icon spacing in autocomplete results */
.autocomplete-result .flex {
  align-items: flex-start;
}

.autocomplete-result .text-lg {
  margin-top: 0.125rem;
}

/* City Switch Button Styles */
.switch-cities-btn {
  background: white;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  padding: 0.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.switch-cities-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: scale(1.05);
}

.switch-cities-btn:active {
  transform: scale(0.95);
}

/* Mobile Switch Button Styles */
.switch-cities-btn-mobile {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  padding: 0.375rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.switch-cities-btn-mobile:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: scale(1.05);
}

.switch-cities-btn-mobile:active {
  transform: scale(0.95);
}

/* Processing Overlay Styles */
.processing-overlay {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.processing-overlay .animate-spin {
  animation: spin 1s linear infinite;
}

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

.processing-overlay .animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* Airline Logo Carousel Animation */
.airline-carousel {
  animation: slideCarousel 8s linear infinite;
}

.airline-logo-item {
  opacity: 0.6;
  transition: all 0.8s ease-in-out;
  transform: scale(0.9);
}

.airline-logo-item.active {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.4));
}

.airline-logo-item.next {
  opacity: 0.9;
  transform: scale(1.05);
}

.airline-logo-item.prev {
  opacity: 0.9;  
  transform: scale(1.05);
}

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

/* Smooth fade animations for logo transitions */
@keyframes logoFadeIn {
  from {
    opacity: 0.3;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes logoFadeOut {
  from {
    opacity: 1;
    transform: scale(1.1);
  }
  to {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

/* Simple Range Slider Styles */
.range-slider {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #d1fae5;
  outline: none;
  border-radius: 6px;
  height: 8px;
}

.range-slider::-webkit-slider-track {
  background: #d1fae5;
  border-radius: 6px;
  height: 8px;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  background: #059669;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.range-slider::-moz-range-track {
  background: #d1fae5;
  border-radius: 6px;
  height: 8px;
  border: none;
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  -moz-appearance: none;
}

.range-slider::-moz-range-thumb:hover {
  background: #059669;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.range-slider:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.range-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.range-slider:focus::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}
