/* استایل کانتینر جستجو */
.ajax-search-wrapper {
    position: relative;
    width: 100%;
}

.ajax-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.ajax-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* استایل نتایج جستجو */
.ajax-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    animation: fadeIn 0.3s ease;
}

.ajax-search-results.active {
    display: block;
}

/* انیمیشن */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* لودینگ */
.search-loading {
    padding: 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* هر آیتم جستجو */
.search-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.search-item:hover {
    background: #f8f9fa;
}

.search-item-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumb {
    font-size: 24px;
    color: #999;
}

.search-item-info {
    flex: 1;
}

.search-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.search-item-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 5px;
}

.search-item-type {
    font-size: 11px;
    color: #007bff;
    font-weight: 500;
}

/* بدون نتیجه */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-results i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.no-results p {
    margin: 10px 0;
    font-size: 16px;
}

.no-results small {
    font-size: 12px;
    color: #999;
}

/* خطا */
.search-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
    font-size: 14px;
}

/* فوتر نتایج */
.search-footer {
    padding: 12px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.view-all-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-size: 13px;
    transition: background 0.3s ease;
}

.view-all-btn:hover {
    background: #0056b3;
    color: #fff;
    text-decoration: none;
}

/* هدر نتایج */
.search-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    color: #333;
}

/* اسکرول */
.ajax-search-results::-webkit-scrollbar {
    width: 6px;
}

.ajax-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ajax-search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .search-item {
        padding: 10px;
    }
    
    .search-item-thumb {
        width: 50px;
        height: 50px;
    }
    
    .search-item-title {
        font-size: 14px;
    }
}