/* Search-specific styles */

#global-search-input {
    border-radius: 0.375rem;
}


/* Search suggestions container */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
}

/* Dark mode for search suggestions */
html[data-theme="dark"] .search-suggestions {
    background-color: var(--dropdown-background);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Fix for search items to ensure text is visible in dark mode */
html[data-theme="dark"] .suggestion-item strong,
html[data-theme="dark"] .suggestion-item small,
html[data-theme="dark"] .suggestion-item div:not(.badge) {
    color: var(--text-color);
}

/* Fix for Bootstrap classes in suggestion items */
html[data-theme="dark"] .suggestion-item .d-flex,
html[data-theme="dark"] .suggestion-item .justify-content-between,
html[data-theme="dark"] .suggestion-item .align-items-center {
    color: var(--text-color);
    background-color: transparent;
}

/* Search suggestion items */
.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

html[data-theme="dark"] .suggestion-item {
    border-bottom-color: var(--border-color);
    color: var(--text-color);
}

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

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f0f0f0;
}

html[data-theme="dark"] .suggestion-item:hover,
html[data-theme="dark"] .suggestion-item.selected {
    background-color: var(--dropdown-link-hover);
}

/* Fix for search item hover state */
html[data-theme="dark"] .suggestion-item:hover strong,
html[data-theme="dark"] .suggestion-item:hover small,
html[data-theme="dark"] .suggestion-item:hover div:not(.badge),
html[data-theme="dark"] .suggestion-item.selected strong,
html[data-theme="dark"] .suggestion-item.selected small,
html[data-theme="dark"] .suggestion-item.selected div:not(.badge) {
    color: var(--text-color);
}

/* Search results page styling */
.search-results-container {
    margin-top: 20px;
}

.search-result-item {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: all 0.2s ease;
}

html[data-theme="dark"] .search-result-item {
    border-color: var(--border-color);
}

.search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #ddd;
}

html[data-theme="dark"] .search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border-color: var(--primary-color);
}

/* UPC scan mode indicator */
.upc-scan-mode {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 10px;
    background-color: #28a745;
    color: white;
}

/* Make sure the suggestions appear above other elements */
.search-suggestions {
    z-index: 9999;
}

/* Highlight matching text in search results */
.highlight {
    background-color: rgba(255, 255, 0, 0.3);
    font-weight: bold;
}

/* Fix text color in dark mode for search item content */
html[data-theme="dark"] .suggestion-item strong,
html[data-theme="dark"] .suggestion-item small {
    color: var(--text-color);
}

html[data-theme="dark"] .highlight {
    background-color: rgba(77, 163, 255, 0.2);
    font-weight: bold;
}


