@import url("airline-search.css");

/* Your existing CSS styles continue below... */
.airline-search-group {
  position: relative;
}

.airline-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.airline-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.airline-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.airline-search-input.has-suggestions {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: #d1d5db;
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  color: #9ca3af;
  pointer-events: none;
  font-size: 1rem;
}

/* Suggestions Dropdown */
.airline-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background-color: #f8fafc;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-content {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.75rem;
}

.airline-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.airline-info {
  flex: 1;
  min-width: 0;
}

.airline-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.airline-name mark {
  background-color: #fef3c7;
  color: #92400e;
  padding: 0 2px;
  border-radius: 2px;
}

.airline-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.airline-code {
  background: #e5e7eb;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 500;
  font-family: monospace;
}

.airline-country {
  color: #9ca3af;
}

.match-score {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Loading and Error States */
.suggestion-loading,
.suggestion-error {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

.suggestion-error {
  color: #dc2626;
  background-color: #fef2f2;
}

.suggestion-no-results {
  padding: 1rem;
}

.no-results-message {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.no-results-suggestions {
  font-size: 0.875rem;
  color: #6b7280;
}

.no-results-suggestions ul {
  margin: 0.5rem 0 0 1rem;
  padding: 0;
}

.no-results-suggestions li {
  margin-bottom: 0.25rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .airline-suggestions {
    max-height: 250px;
  }

  .suggestion-item {
    padding: 1rem 0.75rem;
  }

  .airline-logo {
    width: 28px;
    height: 28px;
  }

  .airline-details {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .match-score {
    display: none; /* Hide on mobile to save space */
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .airline-search-input {
    border-width: 3px;
  }

  .suggestion-item:hover,
  .suggestion-item.selected {
    background-color: #e5e7eb;
    border: 2px solid #374151;
  }

  .airline-name mark {
    background-color: #fbbf24;
    color: #000;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .airline-search-input,
  .suggestion-item {
    transition: none;
  }
}

/* Focus Visible for Better Accessibility */
.suggestion-item:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}
