﻿/**
 * QCMS Filter Sidebar Styles
 * Scoped with .qcms-filter prefix for global safety
 * Used by: Components/Shared/Products/FilterSidebar.razor
 */

/* ========================================
   Main Container
   ======================================== */
.qcms-filter-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* ========================================
   Filter Groups
   ======================================== */
.qcms-filter-group {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

.qcms-filter-group:last-child {
    border-bottom: none;
}

.qcms-filter-header {
    color: #495057;
    transition: color 0.2s;
}

.qcms-filter-header:hover {
    color: #dc3545;
}

/* ========================================
   Collapsed State
   ======================================== */
.qcms-filter-group.collapsed .qcms-filter-options {
    display: none !important;
}

.qcms-filter-group:not(.collapsed) .qcms-filter-options {
    display: block;
}

/* ========================================
   Color Swatches
   ======================================== */
.qcms-color-swatch {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.qcms-color-swatch:hover {
    transform: scale(1.1);
    border-color: #dc3545;
}

.btn-check:checked + .qcms-color-swatch {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.qcms-color-circle {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}

.qcms-color-name {
    font-size: 0.7rem;
    text-align: center;
}

/* ========================================
   Filter Badges
   ======================================== */
.qcms-filter-selected-count {
    font-size: 0.7rem;
}

/* ========================================
   Show More/Less
   ======================================== */
.qcms-more-options {
    margin-top: 0.5rem;
}

.qcms-show-more-btn {
    text-decoration: none;
}

.qcms-show-more-btn:hover {
    text-decoration: underline;
}

/* ========================================
   Price Range Slider (noUiSlider)
   ======================================== */
#priceRangeSlider {
    margin-top: 2rem;
    margin-bottom: 0.7rem;
    padding: 8px;
}

#priceRangeSlider .noUi-base {
    background: #212529;
    border-radius: 3px;
    height: 5px;
    box-shadow: none;
    border: none;
}

#priceRangeSlider .noUi-connect {
    background: #000000;
    box-shadow: none;
}

#priceRangeSlider .noUi-handle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    top: -8px;
}

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

#priceRangeSlider .noUi-handle:hover {
    transform: scale(1.1);
}

#priceRangeSlider .noUi-handle:focus,
#priceRangeSlider .noUi-active {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
    outline: none;
}

#priceRangeSlider .noUi-target {
    border: none;
    box-shadow: none;
}

.qcms-price-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
}

/* ========================================
   Brand Filter Logos
   ======================================== */
.qcms-brand-logo {
    border-radius: 4px;
    border: 1px solid #e9ecef;
    padding: 4px 8px;
    background: white;
    transition: all 0.2s;
    display: block;
}

.form-check-input:checked ~ .form-check-label .qcms-brand-logo {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
}

.form-check-label:hover .qcms-brand-logo {
    transform: scale(1.02);
    border-color: #dc3545;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-filter-type="system-brand"] .form-check-label {
    width: 100%;
    min-height: 40px;
    padding: 4px 0;
}

[data-filter-type="system-brand"] .form-check-label .text-muted {
    margin-left: auto;
    white-space: nowrap;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .qcms-filter-sidebar {
        padding: 1rem;
    }
    
    .qcms-brand-logo {
        max-width: 100px !important;
    }
}
