/* Advanced Search Dropdown Styles */

.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#brandSearch {
    width: 100%;
    padding: 12px 20px 12px 50px;
    font-size: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#brandSearch:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.2);
}

.search-icon {
    position: absolute;
    left: 18px;
    color: #6c757d;
    font-size: 18px;
    z-index: 2;
}

.search-clear-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
}

.search-clear-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Dropdown Styles */
#searchDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
}

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

.search-result-item:hover,
.search-result-item.selected {
    background: #f8f9fa;
    transform: translateX(2px);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    flex-shrink: 0;
}

/* Category-specific icon colors */
.search-result-item:has(.fa-crown) .search-result-icon {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b6914;
}

.search-result-item:has(.fa-running) .search-result-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.search-result-item:has(.fa-tshirt) .search-result-icon {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #6b46c1;
}

.search-result-item:has(.fa-tags) .search-result-icon {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    color: #be185d;
}

.search-result-item:has(.fa-store) .search-result-icon {
    background: linear-gradient(135deg, #96fbc4, #f9f047);
    color: #059669;
}

.search-result-item:has(.fa-gem) .search-result-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.search-result-item:has(.fa-palette) .search-result-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-main {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.search-result-type {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.search-result-category {
    color: #9ca3af;
}

.search-result-ticker {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Search highlight animation for found products */
.search-highlight {
    animation: searchHighlight 2s ease-in-out;
    border: 2px solid #4285f4 !important;
}

@keyframes searchHighlight {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(66, 133, 244, 0);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
    }
}

/* No match message styles */
.search-no-match-message {
    margin: 20px 0;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        margin: 0 10px;
    }
    
    #brandSearch {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 15px 10px 45px;
    }
    
    .search-result-item {
        padding: 10px 12px;
    }
    
    .search-result-main {
        font-size: 14px;
    }
    
    .search-result-meta {
        font-size: 11px;
    }
    
    #searchDropdown {
        max-height: 300px;
    }
}

/* Loading state */
.search-loading {
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

.search-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search suggestions when empty */
.search-suggestions {
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
}

.search-suggestions-title {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.search-suggestion-tag {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-suggestion-tag:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

