/* Best 5 Faceted Search Styles */

.best5-search-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
}

/* Search Form */
.best5-search-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.best5-search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.best5-search-field {
    display: flex;
    flex-direction: column;
}

.best5-search-field label {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #495057;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.best5-search-field input {
    padding: 0.75rem 1rem;
    border: 2px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.best5-search-field input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Autocomplete styling */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: #fff;
    z-index: 1000;
}

.ui-menu-item {
    padding: 0;
    margin: 0;
}

.ui-menu-item-wrapper {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.ui-menu-item-wrapper:hover,
.ui-menu-item-wrapper.ui-state-active {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* Search Actions */
.best5-search-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.best5-search-submit,
.best5-search-clear {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.best5-search-submit {
    background: #0066cc;
    color: #fff;
}

.best5-search-submit:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.best5-search-clear {
    background: #6c757d;
    color: #fff;
}

.best5-search-clear:hover {
    background: #5a6268;
}

/* Results Section */
.best5-search-results {
    min-height: 200px;
}

.best5-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.best5-results-count {
    font-weight: 600;
    color: #495057;
}

.best5-results-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0066cc;
}

.best5-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: best5-spin 0.6s linear infinite;
}

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

/* Results List */
.best5-results-list {
    display: grid;
    gap: 1.5rem;
}

.best5-result-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.best5-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.best5-result-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.5rem;
}

.best5-result-title a {
    color: #0066cc;
    text-decoration: none;
}

.best5-result-title a:hover {
    text-decoration: underline;
}

.best5-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.best5-result-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.best5-result-meta-label {
    font-weight: 600;
}

.best5-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.best5-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e9ecef;
    color: #495057;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.best5-tag.sector {
    background: #d1ecf1;
    color: #0c5460;
}

.best5-tag.location {
    background: #d4edda;
    color: #155724;
}

.best5-result-excerpt {
    color: #6c757d;
    line-height: 1.6;
    margin-top: 1rem;
}

/* Pagination */
.best5-results-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
}

.best5-page-btn {
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.best5-page-btn:hover:not(.active):not(:disabled) {
    background: #f8f9fa;
    border-color: #0066cc;
    color: #0066cc;
}

.best5-page-btn.active {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.best5-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.best5-page-info {
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* No Results */
.best5-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.best5-no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.best5-no-results-message {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.best5-no-results-suggestion {
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .best5-search-fields {
        grid-template-columns: 1fr;
    }
    
    .best5-search-actions {
        flex-direction: column;
    }
    
    .best5-search-submit,
    .best5-search-clear {
        width: 100%;
    }
    
    .best5-results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
