/* Typeahead Input Styling */
#productSearch {
  width: 100%;
  padding: 10px 40px 10px 15px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 20px 20px;
}

#productSearch:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Loading spinner in input field */
#productSearch.tt-loading {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMCIgY3k9IjEwIiByPSI4IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDdiZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgZnJvbT0iMCAxMCAxMCIgdG89IjM2MCAxMCAxMCIgZHVyPSIxcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz48L2NpcmNsZT48L3N2Zz4=');
}

#productSearch::placeholder {
  color: #999;
  font-size: 14px;
}

/* Typeahead Container */
.twitter-typeahead {
  width: 100% !important;
  display: block !important;
}

/* Typeahead Dropdown */
.tt-menu {
  width: 100%;
  margin-top: 8px;
  padding: 0;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 9999;
}

/* Typeahead Hint */
.tt-hint {
  color: #ddd;
}

/* Loading Message in Dropdown */
.tt-loading-message {
  padding: 20px 15px;
  text-align: center;
  color: #007bff;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tt-loading-message:before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid #e0e0e0;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Individual Suggestion Items */
.suggestion-item {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
  display: block;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.tt-cursor .suggestion-item {
  background-color: #f8f9fa;
}

.tt-selectable:hover .suggestion-item {
  background-color: #f8f9fa;
}

.suggestion-details {
  display: flex;
  flex-direction: column;
}

.suggestion-name {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 4px;
}

.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.suggestion-id {
  font-size: 12px;
  color: #666;
  font-family: 'Jost', sans-serif;
}

/* Highlighted text in suggestions */
.tt-highlight {
  font-weight: 600;
  color: #007bff;
  background-color: transparent;
}

/* No Results Message */
.no-results {
  padding: 20px 15px;
  text-align: center;
  color: #999;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
}

/* Scrollbar styling for dropdown */
.tt-menu::-webkit-scrollbar {
  width: 6px;
}

.tt-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 8px;
}

.tt-menu::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 8px;
}

.tt-menu::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #productSearch {
    font-size: 14px;
    padding: 8px 35px 8px 12px;
  }
  
  .suggestion-name {
    font-size: 14px;
  }
  
  .suggestion-id {
    font-size: 11px;
  }
  
  .tt-menu {
    max-height: 300px;
  }
  
  .tt-loading-message {
    padding: 15px;
    font-size: 13px;
  }
}