/* نظام البحث المتقدم */

.advanced-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    padding: 50px 20px;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
}

.advanced-search-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.search-modal {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-modal-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--reaia-teal, #0D9488), var(--reaia-teal-dark, #0F766E));
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    color: white;
    font-size: 1.2rem;
    margin-left: 15px;
}

.advanced-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1.1rem;
    padding: 5px 10px;
}

.advanced-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.search-filters {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.search-filters .filter-btn {
    padding: 8px 18px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-filters .filter-btn:hover {
    border-color: var(--reaia-teal, #0D9488);
    color: var(--reaia-teal, #0D9488);
}

.search-filters .filter-btn.active {
    background: var(--reaia-teal, #0D9488);
    border-color: var(--reaia-teal, #0D9488);
    color: white;
}

.search-results-container {
    max-height: 400px;
    overflow-y: auto;
}

.search-results {
    padding: 20px;
}

.results-count {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

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

.result-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

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

.result-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.result-title mark {
    background: rgba(201, 169, 98, 0.3);
    padding: 0 2px;
    border-radius: 3px;
}

.result-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-excerpt mark {
    background: rgba(201, 169, 98, 0.3);
    padding: 0 2px;
    border-radius: 3px;
}

.result-type {
    font-size: 0.75rem;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 20px;
    color: #666;
}

.search-empty,
.search-no-results,
.search-error,
.search-loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.search-suggestions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.search-suggestions .suggestion {
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-suggestions .suggestion:hover {
    background: var(--reaia-teal, #0D9488);
    color: white;
}

.search-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.search-hint {
    font-size: 0.8rem;
    color: #888;
}

.search-hint kbd {
    background: #333;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .advanced-search-overlay {
        padding: 20px 10px;
    }

    .search-modal {
        border-radius: 15px;
    }

    .search-filters {
        justify-content: center;
    }

    .search-filters .filter-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .search-result-item {
        gap: 10px;
    }

    .result-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}