/* Global Search Styles */

.global-search-wrapper {
  position: relative;
  width: 100%;
}

/* Dropdown Container */
.global-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: 500px;
  overflow-y: auto;
  z-index: 1050;
  min-width: 100%;
}

/* Header */
.global-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background-color: #f9f9f9;
}

.global-search-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.global-search-searching {
  font-size: 0.875rem;
  color: #0056b3;
  font-weight: 500;
}

/* Loading State */
.global-search-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
}

.global-search-spinner .spinner-border {
  color: #0056b3;
}

.global-search-spinner p {
  margin: 0;
  margin-left: 12px;
  color: #6c757d;
  font-size: 0.875rem;
}

/* Results Container */
.global-search-results {
  padding: 0;
}

/* Group */
.global-search-group {
  border-bottom: 1px solid #f0f0f0;
}

.global-search-group:last-of-type {
  border-bottom: none;
}

.global-search-group-header {
  padding: 10px 16px;
  background-color: #f9f9f9;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid #f0f0f0;
}

.global-search-group-count {
  margin-left: 4px;
  font-size: 0.75rem;
  font-weight: 400;
  color: #999;
  text-transform: none;
  letter-spacing: 0;
}

.global-search-group:first-of-type .global-search-group-header {
  border-top: none;
}

/* Search Items */
.global-search-group-items {
  padding: 0;
}

.global-search-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.global-search-item:hover,
.global-search-item:focus {
  background-color: #e0efff;
  outline: none;
}

.global-search-item:focus .global-search-item-title {
  color: #0056b3;
}

.global-search-item:last-child {
  border-bottom: none;
}

.global-search-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #e7f3ff;
  border-radius: 4px;
  margin-right: 12px;
  flex-shrink: 0;
}

.global-search-item-icon i {
  color: #0056b3;
  font-size: 1.1rem;
}

.global-search-item-icon.icon-invoice {
  background-color: #ffe7e7;
}

.global-search-item-icon.icon-invoice i {
  color: #d73b3b;
}

.global-search-item-icon.icon-route {
  background-color: #ffe7f3;
}

.global-search-item-icon.icon-route i {
  color: #d73b7a;
}

.global-search-item-content {
  flex: 1;
  min-width: 0;
}

.global-search-item-title {
  font-weight: 500;
  color: #212529;
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-item-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
  margin: 4px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

.global-search-item-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  white-space: nowrap;
  background-color: #d4edda;
  color: #155724;
}

.global-search-item-time {
  font-size: 0.8rem;
  color: #6c757d;
  white-space: nowrap;
}

/* View All Button */
.global-search-view-all {
  width: 100%;
  padding: 12px 16px;
  background-color: #0056b3;
  color: white;
  border: none;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-transform: none;
}

.global-search-view-all:hover,
.global-search-view-all:focus {
  background-color: #004494;
  outline: none;
}

/* Empty State */
.global-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
}

.global-search-empty-icon {
  font-size: 3rem;
  color: #ccc;
  margin-bottom: 16px;
}

.global-search-empty-text {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 0;
}

/* Focus state on input */
#global-search-input:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

/* Responsive */
@media (max-width: 576px) {
  .global-search-dropdown {
    max-height: 400px;
  }

  .global-search-item {
    padding: 10px 12px;
  }

  .global-search-item-icon {
    width: 32px;
    height: 32px;
  }

  .global-search-item-title {
    font-size: 0.85rem;
  }

  .global-search-item-subtitle {
    font-size: 0.75rem;
  }

  .global-search-empty {
    padding: 32px 12px;
  }
}
