/* Airlinel Booking Page Styles - Task 1.5 */

/* Country and Currency Selectors */
#country-selector,
#currency-selector {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23f97316' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

#country-selector:focus,
#currency-selector:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

/* Modal Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#agency-modal:not(.hidden),
#agency-error-modal:not(.hidden) {
  animation: fadeIn 0.2s ease-in-out;
}

#agency-modal:not(.hidden) > div,
#agency-error-modal:not(.hidden) > div {
  animation: slideIn 0.3s ease-out;
}

/* Modal Overlay */
.modal-overlay {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Agency Modal Styles */
#agency-modal .w-full,
#agency-error-modal .w-full {
  max-width: 28rem;
}

/* Responsive Modal */
@media (max-width: 640px) {
  #agency-modal > div,
  #agency-error-modal > div {
    max-width: 100%;
    border-radius: 1.5rem;
  }

  #agency-modal .p-8,
  #agency-error-modal .p-8 {
    padding: 1.5rem;
  }

  #country-selector,
  #currency-selector {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Select Option Styling */
select {
  cursor: pointer;
  transition: all 0.3s ease;
}

select option {
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 0.5rem;
}

select option:hover {
  background-color: #f97316;
  color: #000000;
}

/* Verification Button Hover State */
#agency-verify-btn {
  transition: all 0.3s ease;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#agency-verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#agency-verify-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}

/* Exchange Rate Display */
#exchange-rate-display {
  display: block;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

#exchange-rate-display.loading {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.4;
  }
}

/* Error Message Styling */
.agency-error-message {
  color: #f87171;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.agency-error-message.show {
  display: block;
}

/* Success Message Styling */
.agency-success-message {
  color: #4ade80;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.agency-success-message.show {
  display: block;
}

/* Loading State */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #f97316;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Modal Icon Styling */
#agency-modal i,
#agency-error-modal i {
  font-size: 1.5rem;
}

/* Grid Layout for Modal */
.modal-grid {
  display: grid;
  gap: 1rem;
}

/* Price Display with Currency */
.currency-price {
  font-weight: 900;
  font-size: 1.875rem;
  letter-spacing: -0.05em;
  transition: color 0.2s ease, font-size 0.2s ease;
}

/* Accessibility: Ensure form fields are properly visible */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
  #country-selector,
  #currency-selector {
    border-width: 2px;
  }

  #agency-verify-btn {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #agency-modal:not(.hidden) > div,
  #agency-error-modal:not(.hidden) > div,
  #country-selector,
  #currency-selector,
  #agency-verify-btn {
    animation: none;
    transition: none;
  }
}
