/* Location Search Autocomplete Styles */

.address-autocomplete {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin-bottom: 1rem;
}

.address-autocomplete input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.address-autocomplete input[type="text"]:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.address-autocomplete input[type="text"]::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* Suggestions dropdown */
.address-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  margin: 4px 0 0 0;
  padding: 0;
  list-style: none;
}

.address-suggestions.hidden {
  display: none;
}

/* Individual suggestion items */
.address-option {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  line-height: 1.4;
  color: #374151;
  transition: background-color 0.15s ease;
}

.address-option:last-child {
  border-bottom: none;
}

.address-option:hover,
.address-option:focus {
  background-color: #f9fafb;
  outline: none;
}

.address-option:active {
  background-color: #f3f4f6;
}

/* Error message styling */
.error-message {
  padding: 12px 16px;
  color: #dc2626;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  list-style: none;
}

/* Loading state (optional enhancement) */
.address-autocomplete.loading input[type="text"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 11-6.219-8.56'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Responsive design */
@media (max-width: 640px) {
  .address-autocomplete {
    max-width: 100%;
  }
  
  .address-autocomplete input[type="text"] {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .address-suggestions {
    margin: 2px 0 0 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  }
  
  .address-option {
    padding: 16px;
    font-size: 16px;
  }
}

/* Focus management for accessibility */
.address-option:focus-visible {
  background-color: #e0e7ff;
  outline: 2px solid #4f46e5;
  outline-offset: -2px;
}

/* Smooth scrolling for long lists */
.address-suggestions {
  scroll-behavior: smooth;
}

/* Custom scrollbar styling for webkit browsers */
.address-suggestions::-webkit-scrollbar {
  width: 6px;
}

.address-suggestions::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.address-suggestions::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.address-suggestions::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}