/**
 * Global Search Dropdown Styles
 * 
 * Styles for the typeahead search suggestions dropdown.
 * Works consistently across all pages.
 */

/* Dropdown Container */
.global-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-height: 500px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
  margin-top: 0.25rem;
}

/* Section Styling */
.global-search-dropdown .suggestion-section {
  border-bottom: 1px solid #e9ecef;
}

.global-search-dropdown .suggestion-section:last-child {
  border-bottom: none;
}

.global-search-dropdown .suggestion-section-header {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6c757d;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

/* Suggestion Item */
.global-search-dropdown .suggestion-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid #f8f9fa;
}

.global-search-dropdown .suggestion-item:hover,
.global-search-dropdown .suggestion-item.active {
  background-color: #f8f9fa;
}

.global-search-dropdown .suggestion-item:last-child {
  border-bottom: none;
}

/* Platform Row Styles */
.global-search-dropdown .platform-row {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: background-color 0.15s;
}

.global-search-dropdown .platform-row:hover,
.global-search-dropdown .platform-row.active {
  background-color: #f8f9fa;
}

.global-search-dropdown .platform-row:last-child {
  border-bottom: none;
}

.global-search-dropdown .platform-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.global-search-dropdown .platform-icon {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
  border-radius: 4px;
  object-fit: cover;
}

.global-search-dropdown .platform-name {
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  font-size: 0.95rem;
}

/* Category Chips Container */
.global-search-dropdown .platform-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-left: 2rem;
}

/* Category Chip Styles - Purple Theme */
.global-search-dropdown .category-chip {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  color: var(--text-primary, #1f2937);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.global-search-dropdown .category-chip:hover:not(.disabled) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.global-search-dropdown .category-chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f3f4f6;
  color: #9ca3af;
}

/* Suggestion Item Image */
.global-search-dropdown .suggestion-item-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  margin-right: 0.75rem;
  border-radius: 4px;
}

/* Trending Panel Grid Layout */
.global-search-dropdown .trending-platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  padding: 0.5rem 0;
}

/* Trending View All Button */
.global-search-dropdown .trending-view-all {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e9ecef;
  text-align: right;
  background: #f8f9fa;
}

.global-search-dropdown .trending-view-all-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  height: 36px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: all 0.2s ease;
}

.global-search-dropdown .trending-view-all-btn:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
  color: #667eea;
  transform: translateY(-1px);
}

/* Responsive Trending Grid */
@media (min-width: 992px) {
  .global-search-dropdown .trending-platforms-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .global-search-dropdown .trending-platforms-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure dropdown appears above other content */
.global-search-dropdown {
  z-index: 1050 !important;
}

/* Ensure parent container allows dropdown to show */
[data-global-search-form],
.navbar-search {
  position: relative;
}

/* Ensure dropdown doesn't get clipped by parent containers */
.navbar-search {
  overflow: visible;
}
