﻿/* ========================================
   ENHANCED AJAX SEARCH POPUP STYLES
   ======================================== */

.search-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.search-popup.search-popup--open {
    visibility: visible;
    opacity: 1;
}

.search-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.search-popup__content {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: searchPopupSlideIn 0.3s ease-out;
}

@keyframes searchPopupSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Header */
.search-popup__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.search-popup__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.search-popup__close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-popup__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Search Form */
.search-popup__form {
    padding: 25px;
    border-bottom: 1px solid #eee;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

#ajaxSearchInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 18px 20px;
    font-size: 1.1rem;
    outline: none;
    color: #333;
}

#ajaxSearchInput::placeholder {
    color: #888;
    font-style: italic;
}

.search-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 18px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
}

.search-submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.search-loading {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.2rem;
}

/* Search Filters */
.search-filters {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.search-filter-btn {
    background: #f0f1f3;
    border: 2px solid transparent;
    color: #666;
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-filter-btn:hover {
    background: #e2e6ea;
    color: #333;
}

.search-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.search-filter-btn i {
    font-size: 0.85rem;
}

/* Search Results */
.search-results {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
    padding: 25px;
}

.search-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.search-welcome i {
    color: #ddd;
    margin-bottom: 15px;
}

.search-welcome h4 {
    color: #333;
    margin-bottom: 10px;
}

.search-welcome p {
    color: #888;
    margin: 0;
}

/* Search Result Categories */
.search-category {
    margin-bottom: 30px;
}

.search-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f1f3;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.search-category-title i {
    color: #667eea;
}

.search-category-count {
    background: #667eea;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* Search Result Items */
.search-result-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.search-result-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-image img {
    transform: scale(1.1);
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #666;
}

.search-result-meta i {
    color: #667eea;
    width: 12px;
}

.search-result-description {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-price {
    font-weight: 600;
    color: #28a745;
    font-size: 1rem;
    margin-top: 5px;
}

.search-result-price .original-price {
    text-decoration: line-through;
    color: #888;
    margin-right: 8px;
    font-size: 0.9rem;
}

/* No Results */
.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.search-no-results i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.search-no-results h4 {
    color: #333;
    margin-bottom: 10px;
}

.search-no-results p {
    color: #888;
    margin-bottom: 20px;
}

/* Quick Actions */
.search-quick-actions {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.search-quick-actions h5 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.quick-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #666;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.quick-action-btn i {
    font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-popup__content {
        top: 5%;
        width: 95%;
        max-height: 90vh;
    }
    
    .search-popup__title {
        font-size: 1.3rem;
    }
    
    .search-popup__form {
        padding: 20px;
    }
    
    #ajaxSearchInput {
        padding: 15px 18px;
        font-size: 1rem;
    }
    
    .search-submit-btn {
        padding: 15px 20px;
        min-width: 60px;
    }
    
    .search-filters {
        gap: 8px;
    }
    
    .search-filter-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .search-results {
        padding: 20px;
        max-height: 400px;
    }
    
    .search-result-item {
        gap: 12px;
        padding: 12px;
    }
    
    .search-result-image {
        width: 60px;
        height: 60px;
    }
    
    .search-result-title {
        font-size: 0.95rem;
    }
    
    .search-result-meta {
        gap: 10px;
        font-size: 0.8rem;
    }
    
    .search-result-description {
        font-size: 0.85rem;
    }
    
    .search-quick-actions {
        padding: 15px 20px;
    }
    
    .quick-action-buttons {
        gap: 8px;
    }
    
    .quick-action-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .search-popup__header {
        padding: 15px 20px;
    }
    
    .search-popup__title {
        font-size: 1.1rem;
    }
    
    .search-filters {
        justify-content: center;
    }
    
    .search-filter-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .quick-action-buttons {
        flex-direction: column;
    }
    
    .quick-action-btn {
        justify-content: center;
    }
}

/* Loading Animation */
.search-loading-results {
    text-align: center;
    padding: 40px 20px;
    color: #667eea;
}

.search-loading-results i {
    font-size: 2rem;
    margin-bottom: 15px;
}

.search-loading-results p {
    margin: 0;
    color: #888;
}

/* Highlight Search Terms */
.search-highlight {
    background: yellow;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}