         timestamp: Date.now()
                });

                // Limit history size
                if (searchHistory.length > MAX_HISTORY_ITEMS) {
                    searchHistory = searchHistory.slice(0, MAX_HISTORY_ITEMS);
                }

                saveSearchHistory();
                updateSearchHistoryUI();
            }

            // Clear search history
            function clearSearchHistory() {
                searchHistory = [];
                saveSearchHistory();
              