/* Modern Search Styles for USA Bazaar */

/* Search Container Animations */
.search-container {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container:focus-within {
    transform: scale(1.02);
}

/* Enhanced Search Input Styles */
.search-input-modern {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-modern:focus {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.1),
        0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Products Page Specific Search Styles */
.products-search-container {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.products-search-container:focus-within {
    transform: translateY(-4px);
}

.products-search-input {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.products-search-input:focus {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.15),
        0 8px 30px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Dark mode search input */
.dark .search-input-modern {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.6));
    border-color: rgba(75, 85, 99, 0.3);
}

.dark .search-input-modern:focus {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.8));
    border-color: rgba(59, 130, 246, 0.6);
}

.dark .products-search-input {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.8));
    border-color: rgba(75, 85, 99, 0.4);
}

.dark .products-search-input:focus {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.9));
    border-color: rgba(59, 130, 246, 0.7);
}

/* Enhanced Voice Search Button */
.voice-search-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-search-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-search-btn:hover::before {
    width: 40px;
    height: 40px;
}

.voice-search-btn:hover {
    transform: scale(1.1);
    color: #3b82f6;
}

.voice-search-btn.listening {
    animation: pulse-voice 1.5s ease-in-out infinite;
    color: #ef4444;
}

@keyframes pulse-voice {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Enhanced Search Suggestions */
.search-suggestions-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideDownSearch 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.products-search-suggestions {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: slideDownSearchEnhanced 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .search-suggestions-modern {
    background: rgba(31, 41, 55, 0.95);
    border-color: rgba(75, 85, 99, 0.3);
}

.dark .products-search-suggestions {
    background: rgba(31, 41, 55, 0.98);
    border-color: rgba(75, 85, 99, 0.4);
}

@keyframes slideDownSearch {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideDownSearchEnhanced {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced Search Filter Buttons */
.search-filter-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.search-filter-btn:hover::before {
    left: 100%;
}

.search-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-filter-btn.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* Products Page Quick Action Buttons */
.quick-action-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.quick-action-btn:hover::before {
    left: 100%;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Enhanced Search Suggestion Items */
.search-suggestion-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-suggestion-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-suggestion-item:hover::before {
    transform: scaleY(1);
}

.search-suggestion-item:hover {
    transform: translateX(8px);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(29, 78, 216, 0.05));
}

.search-suggestion-item.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(29, 78, 216, 0.1));
    border-left: 4px solid #3b82f6;
}

/* Popular Search Tags */
.popular-search-tag {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popular-search-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.popular-search-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.popular-search-tag:hover::before {
    left: 100%;
}

/* Search History Items */
.search-history-item {
    position: relative;
    padding-left: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-history-item::before {
    content: '🕒';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.search-history-item:hover::before {
    opacity: 1;
}

.search-history-item:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(29, 78, 216, 0.05));
    transform: translateX(4px);
}

/* Enhanced Mobile Search */
@media (max-width: 768px) {
    .mobile-search-input {
        font-size: 1.125rem;
        padding: 1rem 1.25rem;
    }
    
    .mobile-search-suggestions {
        max-height: 60vh;
        margin-top: 0.5rem;
    }
    
    .mobile-search-filter-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .products-search-container {
        margin: 0 1rem;
    }
    
    .products-search-suggestions {
        margin: 0 1rem;
        max-height: 50vh;
    }
}

/* Enhanced Search Loading Animation */
.search-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

.products-search-loading {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    animation: spin 0.8s linear infinite;
}

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

/* Enhanced Search Results Count Badge */
.search-results-count {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    animation: pulse-count 2s ease-in-out infinite;
}

@keyframes pulse-count {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Enhanced Search Keyboard Shortcuts */
.search-shortcuts {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
}

.dark .search-shortcuts {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

.search-shortcut-key {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.dark .search-shortcut-key {
    background: rgba(255, 255, 255, 0.1);
}

/* Enhanced Search Input Focus Effects */
.search-input-focus-effect {
    position: relative;
}

.search-input-focus-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.search-input-focus-effect:focus-within::after {
    width: 100%;
}

/* Enhanced Search Suggestions Scrollbar */
.search-suggestions-modern::-webkit-scrollbar,
.products-search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions-modern::-webkit-scrollbar-track,
.products-search-suggestions::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.search-suggestions-modern::-webkit-scrollbar-thumb,
.products-search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
    transition: background 0.3s;
}

.search-suggestions-modern::-webkit-scrollbar-thumb:hover,
.products-search-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

.dark .search-suggestions-modern::-webkit-scrollbar-track,
.dark .products-search-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dark .search-suggestions-modern::-webkit-scrollbar-thumb,
.dark .products-search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.4);
}

.dark .search-suggestions-modern::-webkit-scrollbar-thumb:hover,
.dark .products-search-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* Enhanced Search Input Placeholder Animation */
.search-input-modern::placeholder,
.products-search-input::placeholder {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
}

.search-input-modern:focus::placeholder,
.products-search-input:focus::placeholder {
    opacity: 0.3;
    transform: translateX(10px);
}

/* Enhanced Search Clear Button Animation */
.search-clear-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-clear-btn:hover {
    transform: scale(1.2) rotate(90deg);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Enhanced Search Results Empty State */
.search-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(0, 0, 0, 0.5);
}

.search-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    animation: float-empty 3s ease-in-out infinite;
}

@keyframes float-empty {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.dark .search-empty-state {
    color: rgba(255, 255, 255, 0.5);
}

/* Enhanced Search Suggestions Fade In */
.search-suggestion-fade-in {
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Responsive Design */
@media (max-width: 640px) {
    .search-container {
        margin: 0 1rem;
    }
    
    .search-suggestions-modern {
        margin: 0 1rem;
        max-height: 50vh;
    }
    
    .search-filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .quick-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Enhanced High Contrast Mode Support */
@media (prefers-contrast: high) {
    .search-input-modern,
    .products-search-input {
        border-width: 3px;
    }
    
    .search-suggestions-modern,
    .products-search-suggestions {
        border-width: 2px;
    }
    
    .search-filter-btn,
    .quick-action-btn {
        border-width: 2px;
    }
}

/* Enhanced Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .search-container,
    .search-input-modern,
    .products-search-container,
    .products-search-input,
    .voice-search-btn,
    .search-filter-btn,
    .quick-action-btn,
    .search-suggestion-item,
    .popular-search-tag,
    .search-history-item {
        transition: none;
    }
    
    .search-suggestions-modern,
    .products-search-suggestions {
        animation: none;
    }
    
    .voice-search-btn.listening {
        animation: none;
    }
    
    .search-results-count {
        animation: none;
    }
    
    .search-empty-state i {
        animation: none;
    }
}

/* Enhanced Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .search-input-modern,
    .products-search-input {
        background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.8));
        border-color: rgba(75, 85, 99, 0.4);
        color: white;
    }
    
    .search-input-modern:focus,
    .products-search-input:focus {
        background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.9));
        border-color: rgba(59, 130, 246, 0.7);
    }
    
    .search-suggestions-modern,
    .products-search-suggestions {
        background: rgba(31, 41, 55, 0.98);
        border-color: rgba(75, 85, 99, 0.4);
    }
    
    .search-suggestion-item:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(29, 78, 216, 0.1));
    }
    
    .search-history-item:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(29, 78, 216, 0.1));
    }
} 