/**
 * Product Selector Modal - Filter Styles
 * Filter sidebar, checkboxes, range sliders, toggles
 */

/* ==========================================================================
   Filters Sidebar
   ========================================================================== */

.filters-sidebar {
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
}

/* Sidebar close button - hidden on desktop */
.filters-sidebar__close {
    display: none;
}

/* Filters backdrop - hidden on desktop */
.filters-backdrop {
    display: none;
}

.filters-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

/* Filter Group */
.filter-group {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

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

.filter-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}

.filter-group__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group__icon {
    color: var(--text-muted);
    font-size: 0.625rem;
    transition: transform 0.2s;
}

.filter-group.is-expanded .filter-group__icon {
    transform: rotate(180deg);
}

.filter-group__content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

.filter-group.is-expanded .filter-group__content {
    max-height: 500px;
    opacity: 1;
    padding-top: 8px;
}

/* ==========================================================================
   Price Range Slider
   ========================================================================== */

.price-range-slider {
    padding: 8px 0;
}

.price-range-slider__track-container {
    position: relative;
    height: 6px;
    margin: 16px 0 12px;
}

.price-range-slider__track {
    position: absolute;
    width: 100%;
    height: 6px;
    background-color: var(--border-light);
    border-radius: 3px;
}

.price-range-slider__fill {
    position: absolute;
    height: 6px;
    background-color: var(--accent);
    border-radius: 3px;
}

.price-range-slider__input {
    position: absolute;
    width: 100%;
    height: 6px;
    pointer-events: none;
    appearance: none;
    background: transparent;
    top: 0;
}

/* Z-index layering for dual slider thumbs - prevents attraction when overlapping */
.price-range-slider__input--min {
    z-index: 1;
}

.price-range-slider__input--max {
    z-index: 2;
}

.price-range-slider__input::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 2px solid var(--bg-modal);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.price-range-slider__input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 2px solid var(--bg-modal);
    cursor: pointer;
    pointer-events: all;
}

.price-range-slider__values {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.price-range-slider__value {
    color: var(--text-primary);
    font-weight: 500;
}

.price-range-slider__value--editable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.price-range-slider__value--editable:hover {
    background-color: var(--bg-tertiary);
}

.price-range-slider__inline-input {
    width: 80px;
    padding: 2px 6px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;
}

.price-range-slider__inline-input::-webkit-outer-spin-button,
.price-range-slider__inline-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-range-slider__inline-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 212, 175, 55), 0.3);
}

/* ==========================================================================
   Range Slider Filter (for non-price filters)
   ========================================================================== */

.filter-range-slider {
    padding: 8px 0;
}

.filter-range-slider__value--editable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.filter-range-slider__value--editable:hover {
    background-color: var(--bg-tertiary);
}

.filter-range-slider__inline-input {
    width: 70px;
    padding: 2px 6px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;
}

.filter-range-slider__inline-input::-webkit-outer-spin-button,
.filter-range-slider__inline-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-range-slider__inline-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 212, 175, 55), 0.3);
}

.filter-range-slider__track-container {
    position: relative;
    height: 6px;
    margin: 16px 0 12px;
}

.filter-range-slider__track {
    position: absolute;
    width: 100%;
    height: 6px;
    background-color: var(--border-light);
    border-radius: 3px;
}

.filter-range-slider__fill {
    position: absolute;
    height: 6px;
    background-color: var(--accent);
    border-radius: 3px;
}

.filter-range-slider__input {
    position: absolute;
    width: 100%;
    height: 6px;
    pointer-events: none;
    appearance: none;
    background: transparent;
    top: 0;
}

/* Z-index layering for dual slider thumbs - prevents attraction when overlapping */
.filter-range-slider__input--min {
    z-index: 1;
}

.filter-range-slider__input--max {
    z-index: 2;
}

.filter-range-slider__input::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 2px solid var(--bg-modal);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

.filter-range-slider__input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.filter-range-slider__input::-webkit-slider-thumb:active {
    transform: scale(1.15);
    cursor: grabbing;
}

.filter-range-slider__input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 2px solid var(--bg-modal);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.filter-range-slider__input::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.filter-range-slider__values {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.filter-range-slider__value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8125rem;
}

/* ==========================================================================
   Checkbox Filter
   ========================================================================== */

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.filter-checkbox:hover {
    background-color: var(--bg-tertiary);
}

.filter-checkbox__input {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    background-color: var(--bg-tertiary);
}

.filter-checkbox__input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231a1a1a'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 10px;
    background-position: center;
    background-repeat: no-repeat;
}

.filter-checkbox__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-left: 8px;
}

.filter-checkbox__count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Boolean Toggle Filter
   Scoped to product selector to avoid conflicts with game-selector-modal
   ========================================================================== */

.product-selector-modal .filter-toggle {
    padding: 8px 0;
    display: block;
    cursor: default;
    gap: 0;
}

.product-selector-modal .filter-toggle__switch {
    display: inline-flex;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    padding: 2px;
    border: none;
    box-shadow: none;
    position: static;
    width: auto;
    height: auto;
}

/* Remove the circle pseudo-element from game-selector-modal */
.product-selector-modal .filter-toggle__switch::before,
.product-selector-modal .filter-toggle__switch::after {
    display: none !important;
    content: none !important;
}

.product-selector-modal .filter-toggle__option {
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    user-select: none;
}

/* Remove any pseudo-elements */
.product-selector-modal .filter-toggle__option::before,
.product-selector-modal .filter-toggle__option::after {
    display: none !important;
    content: none !important;
}

.product-selector-modal .filter-toggle__option:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.product-selector-modal .filter-toggle__option:focus {
    outline: none;
    box-shadow: none;
}

.product-selector-modal .filter-toggle__option.is-active {
    background-color: var(--accent);
    color: var(--bg-primary);
    font-weight: 500;
}

.product-selector-modal .filter-toggle__option.is-active:hover {
    background-color: var(--accent-hover);
}

/* ==========================================================================
   Show More Button
   ========================================================================== */

.filter-show-more {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    padding: 8px 0;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

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

/* ==========================================================================
   Compatibility Filter Notice
   ========================================================================== */

.compat-filter-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(var(--warning-rgb), 0.1);
    border: 1px solid rgba(var(--warning-rgb), 0.3);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.compat-filter-notice__icon {
    flex-shrink: 0;
    color: var(--warning);
}

.compat-filter-notice__text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.compat-filter-notice__btn {
    flex-shrink: 0;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--warning);
    border-radius: 4px;
    color: var(--warning);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.compat-filter-notice__btn:hover {
    background: var(--warning);
    color: var(--bg-primary);
}
