/**
 * Smart Search Styles
 * Additional styles for the smart search functionality
 */

/* Search Modal Animation */
#smart-search-modal {
    animation: fadeIn 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: #000 !important;
}

#smart-search-modal .bg-white {
    animation: slideInDown 0.3s ease-out;
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb;
    color: #000 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Search Input Focus States */
#smart-search-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
    border-color: #000;
    background-color: #ffffff;
}

/* Search Suggestions */
.search-suggestion {
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-suggestion:hover {
    background-color: #000 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.search-suggestion.selected {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #000;
}

/* Search Result Items */
.search-result-item {
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #000;
    background-color: #f8f9fa;
}

/* Trending Search Tags */
.trending-search-tag {
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.trending-search-tag:hover {
    background-color: #000 !important;
    color: #fff !important;
    transform: translateY(-1px);
    border-color: #000;
}

/* Recent Search Items */
.recent-search-item {
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: #ffffff;
}

.recent-search-item:hover {
    background-color: #000 !important;
    color: #fff !important;
    transform: translateX(4px);
}

/* Quick Category Buttons */
.quick-category-btn {
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: #ffffff;
}

.quick-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #000;
    background-color: #f8f9fa;
}

/* Search Category and Brand Buttons */
.search-category-btn,
.search-brand-btn {
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.search-category-btn:hover,
.search-brand-btn:hover {
    background-color: #000 !important;
    color: #fff !important;
    transform: translateY(-1px);
    border-color: #000;
}

/* Loading States */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.search-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Results Count Badge */
.search-results-count {
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

/* Search Highlight */
.search-highlight {
    background-color: #000;
    color: #fff;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    #smart-search-modal .bg-white {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    #smart-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .quick-category-btn {
        padding: 0.75rem;
    }
    
    .search-result-item {
        padding: 0.75rem;
    }
}

/* Accessibility Improvements */
.search-suggestion:focus,
.search-result-item:focus,
.trending-search-tag:focus,
.recent-search-item:focus,
.quick-category-btn:focus,
.search-category-btn:focus,
.search-brand-btn:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .search-suggestion:hover,
    .search-result-item:hover,
    .trending-search-tag:hover,
    .recent-search-item:hover,
    .quick-category-btn:hover,
    .search-category-btn:hover,
    .search-brand-btn:hover {
        outline: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .search-suggestion,
    .search-result-item,
    .trending-search-tag,
    .recent-search-item,
    .quick-category-btn,
    .search-category-btn,
    .search-brand-btn {
        transition: none;
    }
    
    #smart-search-modal,
    #smart-search-modal .bg-white {
        animation: none;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    #smart-search-modal .bg-white {
    
        color: #f9fafb;
    }
    
    #smart-search-input {
        /* background-color: #374151; */
        /* border-color: #4b5563; */
        color: #000;
    }
    
    .search-suggestion,
    .trending-search-tag,
    .search-category-btn,
    .search-brand-btn {
        /* background-color: #374151; */
        color: #000;
    }
    
    .search-suggestion:hover,
    .trending-search-tag:hover,
    .search-category-btn:hover,
    .search-brand-btn:hover {
        /* background-color: #4b5563; */
        color: #f9fafb;
    }
}
