/* =============================================================================
   SEARCH FILTER MODAL
   ============================================================================= */

/* Overlay */
.search-filter-modal-overlay {
    position: fixed;
    top: 0;
    inset-inline: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

/* Modal Container */
.search-filter-modal {
    background: var(--bg-primary, #ffffff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.search-filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    background: var(--bg-secondary, #f8f9fa);
}

.search-filter-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.search-filter-modal-header .close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary, #666);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.search-filter-modal-header .close-button:hover {
    background-color: var(--bg-hover, #e9ecef);
}

/* Body */
.search-filter-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Section Tabs */
.filter-section-tabs {
    display: flex;
    flex-direction: column;
    width: 180px;
    background: var(--bg-secondary, #f8f9fa);
    border-inline-end: 1px solid var(--border-color, #e0e0e0);
    padding: 0.5rem;
    gap: 0.25rem;
    /* Five short tabs never overflow, and the content pane beside them owns
       the scrolling — so this sidebar showed a scrollbar for nothing. */
    overflow-y: visible;
}

.filter-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    text-align: start;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.filter-tab:hover {
    background-color: var(--bg-hover, #e9ecef);
    color: var(--text-primary, #1a1a1a);
}

.filter-tab.active {
    background-color: var(--accent-color);
    color: white;
    font-weight: 500;
}

/* Section Content */
.filter-section-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Footer */
.search-filter-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    background: var(--bg-secondary, #f8f9fa);
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-clear,
.btn-cancel,
.btn-apply {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear {
    background: none;
    border: 1px solid var(--danger-color, #dc3545);
    color: var(--danger-color, #dc3545);
}

.btn-clear:hover {
    background-color: var(--danger-color, #dc3545);
    color: white;
}

.btn-cancel {
    background: none;
    border: 1px solid var(--border-color, #ccc);
    color: var(--text-secondary, #666);
}

.btn-cancel:hover {
    background-color: var(--bg-hover, #e9ecef);
}

.btn-apply {
    background-color: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: white;
}

.btn-apply:hover {
    background-color: var(--accent-hover, #3a7bc8);
}

/* =============================================================================
   QUALITY THRESHOLD FILTER
   ============================================================================= */

.quality-threshold-filter {
    padding: 1rem 0;
}

.quality-threshold-filter .filter-header {
    margin-bottom: 1rem;
}

.quality-threshold-filter .filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.quality-threshold-filter .filter-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.quality-threshold-filter .filter-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
}

.quality-threshold-filter .filter-content {
    padding-inline-start: 1.5rem;
}

.quality-threshold-filter .slider-container {
    margin-bottom: 0.75rem;
}

.quality-threshold-filter .quality-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary, #e0e0e0);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.quality-threshold-filter .quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quality-threshold-filter .quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quality-threshold-filter .slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
}

.quality-threshold-filter .slider-label-current {
    font-weight: 600;
    color: var(--accent-color);
}

.quality-threshold-filter .filter-description {
    color: var(--text-secondary, #666);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* =============================================================================
   RRF WEIGHTS FILTER
   ============================================================================= */

.rrf-weights-filter {
    padding: 1rem 0;
}

.rrf-weights-filter .filter-header {
    margin-bottom: 1.5rem;
}

.rrf-weights-filter .filter-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.rrf-weights-filter .weight-sliders {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rrf-weights-filter .weight-slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rrf-weights-filter .weight-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rrf-weights-filter .weight-name {
    font-size: 0.95rem;
    color: var(--text-primary, #1a1a1a);
}

.rrf-weights-filter .weight-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 45px;
    text-align: end;
}

.rrf-weights-filter .weight-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

/* Lexical slider - blue */
.rrf-weights-filter .lexical-slider {
    background: linear-gradient(to left, var(--color-primary) 0%, #e0e0e0 0%);
}

.rrf-weights-filter .lexical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rrf-weights-filter .lexical-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
}

/* Semantic slider - green */
.rrf-weights-filter .semantic-slider {
    background: linear-gradient(to left, var(--color-primary) 0%, #e0e0e0 0%);
}

.rrf-weights-filter .semantic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rrf-weights-filter .semantic-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
}

/* Authority slider - orange */
.rrf-weights-filter .authority-slider {
    background: linear-gradient(to left, #fd7e14 0%, #e0e0e0 0%);
}

.rrf-weights-filter .authority-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fd7e14;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rrf-weights-filter .authority-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fd7e14;
    cursor: pointer;
    border: none;
}

.rrf-weights-filter .weights-summary {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

/* =============================================================================
   ADVANCED SEARCH BUTTON
   ============================================================================= */

.advanced-search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.advanced-search-button:hover:not(:disabled) {
    background: var(--bg-hover, #e9ecef);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.advanced-search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.advanced-search-button .filter-badge {
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* =============================================================================
   LOADING STATE
   ============================================================================= */

.filter-section-content .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary, #666);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 600px) {
    .search-filter-modal {
        max-height: 95vh;
    }
    
    .search-filter-modal-body {
        flex-direction: column;
    }
    
    .filter-section-tabs {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-inline-end: none;
        border-bottom: 1px solid var(--border-color, #e0e0e0);
    }
    
    .filter-tab {
        flex: 1;
        min-width: fit-content;
        text-align: center;
    }
}