/* Task Complaint Form - Asset Search Dropdown Styling */
/* Last Updated: 2025-11-15 */

/* Asset Search Dropdown Container */
#asset_search_dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1051 !important;
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: white !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
  margin-top: 2px !important;
  margin-bottom: 0 !important;
}

#asset_search_dropdown.show {
  display: block !important;
}

/* Individual Asset Option Item */
.asset-option {
  padding: 10px 12px !important;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.15s ease !important;
  user-select: none;
  color: #333;
  font-size: 0.875rem;
}

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

.asset-option:hover {
  background-color: #f8f9fa !important;
  transition: background-color 0.15s ease;
}

.asset-option:focus {
  outline: none;
  background-color: #e7f3ff;
  border-left: 3px solid #0d6efd;
  padding-left: 9px;
}

.asset-option:active {
  background-color: #e0e0e0;
}

/* Parent Container Overflow Fix */
.card {
  position: relative !important;
  overflow: visible !important;
}

.card-body {
  overflow: visible !important;
}

.container-fluid {
  overflow: visible !important;
}

.container {
  overflow: visible !important;
}

.position-relative {
  position: relative !important;
}

/* Scrollbar Styling - Webkit browsers (Chrome, Safari, Edge) */
#asset_search_dropdown::-webkit-scrollbar {
  width: 6px;
}

#asset_search_dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#asset_search_dropdown::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

#asset_search_dropdown::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Firefox Scrollbar */
#asset_search_dropdown {
  scrollbar-color: #888 #f1f1f1;
  scrollbar-width: thin;
}

/* Loading State */
#asset_search_dropdown .spinner-border {
  display: block;
  margin: 0 auto;
  padding: 10px 0;
}

/* No Results Message */
#asset_search_dropdown > div[style*="text-align: center"] {
  padding: 15px 10px;
  color: #999;
  font-size: 0.875rem;
  text-align: center !important;
}

/* Error Message Styling */
#asset_search_dropdown > div[style*="color: #d32f2f"] {
  color: #dc3545 !important;
  padding: 15px 10px;
  font-size: 0.875rem;
  text-align: center;
  background-color: #fff5f5;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  #asset_search_dropdown {
    max-height: 250px;
    font-size: 0.8125rem;
  }
  
  .asset-option {
    padding: 8px 10px !important;
    font-size: 0.8125rem;
  }
}

@media (max-width: 576px) {
  #asset_search_dropdown {
    max-height: 200px;
    font-size: 0.75rem;
  }
  
  .asset-option {
    padding: 6px 8px !important;
    font-size: 0.75rem;
  }
}
