/* Unified Filter Component Styles */

.filters-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filters-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.clear-all-btn {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.filter-group {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #e0e0e0;
}

.filter-header:hover {
    background: #e9ecef;
}

.filter-header.collapsed {
    border-bottom: none;
}

.filter-group h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-arrow {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s ease;
    user-select: none;
}

.filter-header.collapsed .dropdown-arrow {
    transform: rotate(-90deg);
}

.filter-content {
    padding: 20px;
    background: #fff;
    transition: all 0.3s ease;
    display: none; /* Start collapsed by default */
}

.filter-content.expanded {
    display: block;
}

.display-only-badge {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
}

/* Price Range Styles */
.price-range-container {
    margin-top: 0;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-inputs input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.price-inputs span {
    color: #666;
    font-size: 0.9rem;
}

.price-slider {
    margin: 15px 5px;
}

/* NoUI Slider Customization */
.noUi-target {
    background: #f5f5f5;
    border-radius: 4px;
    border: none;
    box-shadow: none;
    height: 6px;
}

.noUi-connect {
    background: #2196f3;
}

.noUi-handle {
    background: #fff;
    border: 2px solid #2196f3;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

.noUi-tooltip {
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* Checkbox Filter Styles */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
    font-size: 0.9rem;
    color: #333;
    transition: color 0.3s ease;
}

.filter-option:hover:not(.display-only) {
    color: #2196f3;
}

.filter-option.display-only {
    cursor: default;
    opacity: 0.7;
}

.filter-option input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-option input[type="checkbox"]:checked + .checkmark {
    background: #2196f3;
    border-color: #2196f3;
}

.filter-option input[type="checkbox"]:checked + .checkmark:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-option input[type="checkbox"]:disabled + .checkmark {
    background: #e8f5e8;
    border-color: #4caf50;
}

.filter-option input[type="checkbox"]:disabled + .checkmark:after {
    border-color: #4caf50;
}

/* Apply Filters Button */
.apply-filters-btn {
    width: 100%;
    background: #2196f3;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.apply-filters-btn:hover {
    background: #1976d2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-sidebar {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .clear-all-btn {
        align-self: flex-end;
    }
    
    .filter-header {
        padding: 12px 15px;
    }
    
    .filter-content {
        padding: 15px;
    }
    
    .price-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .price-inputs span {
        order: -1;
        text-align: center;
    }
    
    .filter-group {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .filters-sidebar {
        padding: 12px;
    }
    
    .filter-option {
        padding: 6px 0;
        font-size: 0.85rem;
    }
    
    .checkmark {
        width: 16px;
        height: 16px;
    }
    
    .filter-option input[type="checkbox"]:checked + .checkmark:after {
        left: 4px;
        top: 1px;
        width: 3px;
        height: 7px;
    }
}

/* Loading State */
.filters-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.filters-loading:after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}