/**
 * Advanced Search Styles
 * For saved searches, recent filters, and client-side filtering
 */

/* Saved Searches Section */
.saved-searches-section {
    background-color: var(--bs-light);
    padding: 1rem;
    border-radius: 0.375rem;
}

[data-bs-theme="dark"] .saved-searches-section {
    background-color: var(--bs-dark);
}

.saved-searches-list,
.recent-filters-list {
    max-height: 200px;
    overflow-y: auto;
}

.saved-search-item {
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .saved-search-item {
    background: var(--bs-body-bg);
}

.saved-search-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.saved-search-link {
    display: block;
    color: inherit;
    padding: 0.25rem 0.5rem;
}

.saved-search-link:hover {
    color: var(--bs-primary);
}

.saved-search-link strong {
    font-size: 0.9rem;
}

.saved-search-link small {
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
}

.delete-search {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Recent Filters */
.recent-filter-item {
    padding: 0.4rem 0.5rem;
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .recent-filter-item {
    background: var(--bs-body-bg);
}

.recent-filter-item:hover {
    border-color: var(--bs-secondary);
    background: var(--bs-light);
}

[data-bs-theme="dark"] .recent-filter-item:hover {
    background: var(--bs-dark);
}

.recent-filter-link {
    display: block;
    color: inherit;
    font-size: 0.85rem;
}

.recent-filter-link:hover {
    color: var(--bs-secondary);
}

/* Scrollbar Styling */
.saved-searches-list::-webkit-scrollbar,
.recent-filters-list::-webkit-scrollbar {
    width: 6px;
}

.saved-searches-list::-webkit-scrollbar-track,
.recent-filters-list::-webkit-scrollbar-track {
    background: var(--bs-light);
    border-radius: 3px;
}

.saved-searches-list::-webkit-scrollbar-thumb,
.recent-filters-list::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 3px;
}

.saved-searches-list::-webkit-scrollbar-thumb:hover,
.recent-filters-list::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* Empty State */
.saved-searches-list p,
.recent-filters-list p {
    padding: 1rem;
    text-align: center;
    font-style: italic;
}

/* Animations */
.saved-search-item,
.recent-filter-item {
    animation: fadeIn 0.3s ease;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .saved-searches-section {
        padding: 0.75rem;
    }
    
    .saved-search-link strong {
        font-size: 0.85rem;
    }
    
    .saved-search-link small {
        font-size: 0.7rem;
    }
    
    .recent-filter-link {
        font-size: 0.8rem;
    }
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bs-dark);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

/* Button Hover States */
#saveCurrentSearch:hover {
    background-color: var(--bs-primary);
    color: white;
}

.delete-search:hover {
    background-color: var(--bs-danger);
    color: white;
    border-color: var(--bs-danger);
}

/* Section Headers */
.saved-searches-section h6 {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bs-secondary);
}

[data-bs-theme="dark"] .saved-searches-section h6 {
    color: var(--bs-light);
}

.saved-searches-section h6 i {
    margin-right: 0.5rem;
}

/* Save Search Modal */
#saveSearchModal .modal-body .text-muted strong {
    color: var(--bs-primary);
}

#saveSearchModal input.is-invalid {
    border-color: var(--bs-danger);
}

#saveSearchModal input.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Delete Confirmation Modal */
#deleteSearchModal .modal-header {
    border-bottom: none;
}

#deleteSearchModal .modal-body p:first-child {
    margin-bottom: 1rem;
}
