/* ============================================
   RSL Filter Component
   Version: 1.0.0
   Description: Premium global filter system with
   multiple UI styles, pub/sub architecture,
   and full accessibility support.
   ============================================ */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    /* Filter Colors */
    --rsl-filter-bg: #f8f9fa;
    --rsl-filter-bg-hover: #e9ecef;
    --rsl-filter-bg-active: #6E7BFF;
    --rsl-filter-bg-active-hover: #5a67d8;
    --rsl-filter-text: #495057;
    --rsl-filter-text-hover: #212529;
    --rsl-filter-text-active: #ffffff;
    --rsl-filter-border: #dee2e6;
    --rsl-filter-border-active: #6E7BFF;
    --rsl-filter-focus-ring: rgba(110, 123, 255, 0.25);

    /* Filter Badge */
    --rsl-filter-badge-bg: #6E7BFF;
    --rsl-filter-badge-text: #ffffff;
    --rsl-filter-badge-bg-active: #ffffff;
    --rsl-filter-badge-text-active: #6E7BFF;

    /* Filter Sizing */
    --rsl-filter-height: 40px;
    --rsl-filter-height-sm: 32px;
    --rsl-filter-height-lg: 48px;
    --rsl-filter-padding: 0.5rem 1rem;
    --rsl-filter-padding-sm: 0.375rem 0.75rem;
    --rsl-filter-padding-lg: 0.625rem 1.25rem;
    --rsl-filter-font-size: 0.9375rem;
    --rsl-filter-font-size-sm: 0.8125rem;
    --rsl-filter-font-size-lg: 1rem;
    --rsl-filter-border-radius: 6px;
    --rsl-filter-gap: 0.5rem;

    /* Animations */
    --rsl-filter-transition: all 0.2s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --rsl-filter-bg: #2d3748;
    --rsl-filter-bg-hover: #3d4a5c;
    --rsl-filter-bg-active: #6E7BFF;
    --rsl-filter-text: #e2e8f0;
    --rsl-filter-text-hover: #f7fafc;
    --rsl-filter-text-active: #ffffff;
    --rsl-filter-border: #4a5568;
    --rsl-filter-border-active: #6E7BFF;
    --rsl-filter-focus-ring: rgba(110, 123, 255, 0.4);
}

/* ============================================
   Filter Container (Base)
   ============================================ */
[data-rsl-filter] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--rsl-filter-gap);
    position: relative;
}

[data-rsl-filter][data-filter-layout="vertical"] {
    flex-direction: column;
    align-items: stretch;
}

/* Filter Label */
.rsl-filter-label {
    font-size: var(--rsl-filter-font-size);
    font-weight: 600;
    color: var(--rsl-filter-text);
    margin-right: 0.5rem;
}

[data-rsl-filter][data-filter-layout="vertical"] .rsl-filter-label {
    margin-right: 0;
    margin-bottom: 0.5rem;
}

/* ============================================
   Filter Option (Base Button Style)
   ============================================ */
.rsl-filter-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: var(--rsl-filter-height);
    padding: var(--rsl-filter-padding);
    font-size: var(--rsl-filter-font-size);
    font-weight: 500;
    font-family: inherit;
    color: var(--rsl-filter-text);
    background: var(--rsl-filter-bg);
    border: 1px solid var(--rsl-filter-border);
    border-radius: var(--rsl-filter-border-radius);
    cursor: pointer;
    transition: var(--rsl-filter-transition);
    white-space: nowrap;
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
}

.rsl-filter-option:hover {
    background: var(--rsl-filter-bg-hover);
    color: var(--rsl-filter-text-hover);
    border-color: var(--rsl-filter-border);
}

.rsl-filter-option:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--rsl-filter-focus-ring);
    z-index: 1;
}

.rsl-filter-option:focus-visible {
    outline: 2px solid var(--rsl-filter-bg-active);
    outline-offset: 2px;
}

/* Active State */
.rsl-filter-option[aria-pressed="true"],
.rsl-filter-option.active,
.rsl-filter-option[data-active="true"] {
    background: var(--rsl-filter-bg-active);
    color: var(--rsl-filter-text-active);
    border-color: var(--rsl-filter-border-active);
    font-weight: 600;
}

.rsl-filter-option[aria-pressed="true"]:hover,
.rsl-filter-option.active:hover,
.rsl-filter-option[data-active="true"]:hover {
    background: var(--rsl-filter-bg-active-hover);
    border-color: var(--rsl-filter-bg-active-hover);
}

/* Disabled State */
.rsl-filter-option:disabled,
.rsl-filter-option[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   Pills Style (Default)
   ============================================ */
[data-rsl-filter][data-filter-style="pills"] {
    gap: 0.375rem;
}

[data-rsl-filter][data-filter-style="pills"] .rsl-filter-option {
    border-radius: 9999px;
    padding: 0.375rem 1rem;
}

/* ============================================
   Button Group Style
   ============================================ */
[data-rsl-filter][data-filter-style="buttons"] {
    gap: 0;
}

[data-rsl-filter][data-filter-style="buttons"] .rsl-filter-option {
    border-radius: 0;
    margin-left: -1px;
}

[data-rsl-filter][data-filter-style="buttons"] .rsl-filter-option:first-of-type {
    border-radius: var(--rsl-filter-border-radius) 0 0 var(--rsl-filter-border-radius);
    margin-left: 0;
}

[data-rsl-filter][data-filter-style="buttons"] .rsl-filter-option:last-of-type {
    border-radius: 0 var(--rsl-filter-border-radius) var(--rsl-filter-border-radius) 0;
}

[data-rsl-filter][data-filter-style="buttons"] .rsl-filter-option:only-of-type {
    border-radius: var(--rsl-filter-border-radius);
}

/* ============================================
   Chips Style (Removable Tags)
   ============================================ */
[data-rsl-filter][data-filter-style="chips"] {
    gap: 0.5rem;
}

[data-rsl-filter][data-filter-style="chips"] .rsl-filter-option {
    border-radius: 9999px;
    padding: 0.375rem 0.75rem;
    gap: 0.375rem;
}

[data-rsl-filter][data-filter-style="chips"] .rsl-filter-option[aria-pressed="true"] {
    padding-right: 0.5rem;
}

.rsl-filter-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 0.25rem;
    padding: 0;
    font-size: 0.75rem;
    color: inherit;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease;
    opacity: 0.8;
}

.rsl-filter-chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.rsl-filter-chip-remove:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 1px;
}

/* ============================================
   Toggle Style (Binary Switch)
   ============================================ */
[data-rsl-filter][data-filter-style="toggle"] {
    gap: 0;
}

.rsl-filter-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.rsl-filter-toggle-track {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--rsl-filter-bg);
    border: 2px solid var(--rsl-filter-border);
    border-radius: 9999px;
    transition: var(--rsl-filter-transition);
}

.rsl-filter-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--rsl-filter-text);
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
}

.rsl-filter-toggle[aria-pressed="true"] .rsl-filter-toggle-track,
.rsl-filter-toggle.active .rsl-filter-toggle-track {
    background: var(--rsl-filter-bg-active);
    border-color: var(--rsl-filter-border-active);
}

.rsl-filter-toggle[aria-pressed="true"] .rsl-filter-toggle-track::after,
.rsl-filter-toggle.active .rsl-filter-toggle-track::after {
    transform: translateX(24px);
    background: #ffffff;
}

.rsl-filter-toggle:focus .rsl-filter-toggle-track {
    box-shadow: 0 0 0 3px var(--rsl-filter-focus-ring);
}

.rsl-filter-toggle-label {
    font-size: var(--rsl-filter-font-size);
    color: var(--rsl-filter-text);
}

/* ============================================
   Dropdown Style
   ============================================ */
[data-rsl-filter][data-filter-style="dropdown"] {
    position: relative;
}

.rsl-filter-dropdown {
    position: relative;
    min-width: 180px;
}

.rsl-filter-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--rsl-filter-height);
    padding: var(--rsl-filter-padding);
    font-size: var(--rsl-filter-font-size);
    font-weight: 500;
    color: var(--rsl-filter-text);
    background: var(--rsl-filter-bg);
    border: 1px solid var(--rsl-filter-border);
    border-radius: var(--rsl-filter-border-radius);
    cursor: pointer;
    transition: var(--rsl-filter-transition);
}

.rsl-filter-dropdown-trigger:hover {
    background: var(--rsl-filter-bg-hover);
    border-color: var(--rsl-filter-border);
}

.rsl-filter-dropdown-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--rsl-filter-focus-ring);
}

.rsl-filter-dropdown-trigger[aria-expanded="true"] {
    border-color: var(--rsl-filter-border-active);
}

.rsl-filter-dropdown-arrow {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.rsl-filter-dropdown-trigger[aria-expanded="true"] .rsl-filter-dropdown-arrow {
    transform: rotate(180deg);
}

.rsl-filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    background: var(--rsl-filter-bg);
    border: 1px solid var(--rsl-filter-border);
    border-radius: var(--rsl-filter-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.rsl-filter-dropdown-menu[data-open="true"],
.rsl-filter-dropdown-trigger[aria-expanded="true"] + .rsl-filter-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rsl-filter-dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: var(--rsl-filter-font-size);
    color: var(--rsl-filter-text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.rsl-filter-dropdown-option:hover,
.rsl-filter-dropdown-option:focus {
    background: var(--rsl-filter-bg-hover);
    outline: none;
}

.rsl-filter-dropdown-option[aria-selected="true"],
.rsl-filter-dropdown-option.selected {
    background: rgba(110, 123, 255, 0.1);
    color: var(--rsl-filter-bg-active);
    font-weight: 600;
}

.rsl-filter-dropdown-option[aria-selected="true"]::after,
.rsl-filter-dropdown-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--rsl-filter-bg-active);
}

/* ============================================
   Search Style
   ============================================ */
[data-rsl-filter][data-filter-style="search"] {
    min-width: 200px;
    max-width: 100%;
    width: 100%;
}

.rsl-filter-search {
    position: relative;
    width: 100%;
}

.rsl-filter-search-input {
    width: 100%;
    box-sizing: border-box;
    height: var(--rsl-filter-height);
    padding: var(--rsl-filter-padding);
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    font-size: var(--rsl-filter-font-size);
    font-family: inherit;
    color: var(--rsl-filter-text);
    background: var(--rsl-filter-bg);
    border: 1px solid var(--rsl-filter-border);
    border-radius: var(--rsl-filter-border-radius);
    transition: var(--rsl-filter-transition);
}

.rsl-filter-search-input:hover {
    background: var(--rsl-filter-bg-hover);
}

.rsl-filter-search-input:focus {
    outline: none;
    border-color: var(--rsl-filter-border-active);
    box-shadow: 0 0 0 3px var(--rsl-filter-focus-ring);
}

.rsl-filter-search-input::placeholder {
    color: var(--rsl-filter-text);
    opacity: 0.6;
}

.rsl-filter-search-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    transform: translateY(-50%);
    color: var(--rsl-filter-text);
    opacity: 0.5;
    pointer-events: none;
}

.rsl-filter-search-clear {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0.75rem;
    color: var(--rsl-filter-text);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.rsl-filter-search-input:not(:placeholder-shown) + .rsl-filter-search-icon + .rsl-filter-search-clear,
.rsl-filter-search-clear[data-visible="true"] {
    opacity: 0.6;
    visibility: visible;
}

.rsl-filter-search-clear:hover {
    opacity: 1;
    background: var(--rsl-filter-bg-hover);
}

.rsl-filter-search-clear:focus {
    outline: 2px solid var(--rsl-filter-border-active);
    outline-offset: 1px;
}

/* ============================================
   Radio Style
   ============================================ */
[data-rsl-filter][data-filter-style="radio"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
}

.rsl-filter-radio {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}

.rsl-filter-radio-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rsl-filter-radio-control {
    position: relative;
    width: 20px;
    height: 20px;
    background: var(--rsl-filter-bg);
    border: 2px solid var(--rsl-filter-border);
    border-radius: 50%;
    transition: var(--rsl-filter-transition);
}

.rsl-filter-radio-control::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--rsl-filter-bg-active);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
}

.rsl-filter-radio-input:checked + .rsl-filter-radio-control {
    border-color: var(--rsl-filter-border-active);
}

.rsl-filter-radio-input:checked + .rsl-filter-radio-control::after {
    transform: translate(-50%, -50%) scale(1);
}

.rsl-filter-radio-input:focus + .rsl-filter-radio-control {
    box-shadow: 0 0 0 3px var(--rsl-filter-focus-ring);
}

.rsl-filter-radio-label {
    font-size: var(--rsl-filter-font-size);
    color: var(--rsl-filter-text);
}

/* ============================================
   Checkbox Style (Multi-select)
   ============================================ */
[data-rsl-filter][data-filter-style="checkbox"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
}

.rsl-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}

.rsl-filter-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rsl-filter-checkbox-control {
    position: relative;
    width: 20px;
    height: 20px;
    background: var(--rsl-filter-bg);
    border: 2px solid var(--rsl-filter-border);
    border-radius: 4px;
    transition: var(--rsl-filter-transition);
}

.rsl-filter-checkbox-control::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 0.625rem;
    color: #ffffff;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
}

.rsl-filter-checkbox-input:checked + .rsl-filter-checkbox-control {
    background: var(--rsl-filter-bg-active);
    border-color: var(--rsl-filter-border-active);
}

.rsl-filter-checkbox-input:checked + .rsl-filter-checkbox-control::after {
    transform: translate(-50%, -50%) scale(1);
}

.rsl-filter-checkbox-input:focus + .rsl-filter-checkbox-control {
    box-shadow: 0 0 0 3px var(--rsl-filter-focus-ring);
}

.rsl-filter-checkbox-label {
    font-size: var(--rsl-filter-font-size);
    color: var(--rsl-filter-text);
}

/* ============================================
   Filter Badge (Count)
   ============================================ */
.rsl-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--rsl-filter-badge-text);
    background: var(--rsl-filter-badge-bg);
    border-radius: 9999px;
    margin-left: 0.375rem;
}

.rsl-filter-option[aria-pressed="true"] .rsl-filter-badge,
.rsl-filter-option.active .rsl-filter-badge {
    color: var(--rsl-filter-badge-text-active);
    background: var(--rsl-filter-badge-bg-active);
}

/* ============================================
   Clear All Button
   ============================================ */
.rsl-filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #dc3545;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--rsl-filter-border-radius);
    cursor: pointer;
    transition: var(--rsl-filter-transition);
    opacity: 0;
    visibility: hidden;
}

.rsl-filter-clear[data-visible="true"],
[data-rsl-filter][data-has-active="true"] .rsl-filter-clear {
    opacity: 1;
    visibility: visible;
}

.rsl-filter-clear:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
}

.rsl-filter-clear:focus {
    outline: 2px solid rgba(220, 53, 69, 0.5);
    outline-offset: 2px;
}

/* ============================================
   Active Filters Summary Bar
   ============================================ */
.rsl-filter-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(110, 123, 255, 0.08);
    border: 1px solid rgba(110, 123, 255, 0.2);
    border-radius: var(--rsl-filter-border-radius);
    margin-top: 0.75rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.3s ease, margin 0.2s ease, padding 0.2s ease;
}

.rsl-filter-summary[data-visible="true"] {
    opacity: 1;
    max-height: 200px;
}

.rsl-filter-summary-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rsl-filter-text);
    margin-right: 0.25rem;
}

.rsl-filter-summary-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rsl-filter-text-active);
    background: var(--rsl-filter-bg-active);
    border-radius: 9999px;
}

.rsl-filter-summary-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    font-size: 0.625rem;
    color: inherit;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rsl-filter-summary-tag-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Screen Reader Only (Live Region)
   ============================================ */
.rsl-filter-announce {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Size Variants
   ============================================ */
[data-rsl-filter][data-filter-size="sm"] .rsl-filter-option,
[data-rsl-filter][data-filter-size="sm"] .rsl-filter-dropdown-trigger,
[data-rsl-filter][data-filter-size="sm"] .rsl-filter-search-input {
    height: var(--rsl-filter-height-sm);
    padding: var(--rsl-filter-padding-sm);
    font-size: var(--rsl-filter-font-size-sm);
}

[data-rsl-filter][data-filter-size="lg"] .rsl-filter-option,
[data-rsl-filter][data-filter-size="lg"] .rsl-filter-dropdown-trigger,
[data-rsl-filter][data-filter-size="lg"] .rsl-filter-search-input {
    height: var(--rsl-filter-height-lg);
    padding: var(--rsl-filter-padding-lg);
    font-size: var(--rsl-filter-font-size-lg);
}

/* ============================================
   Color Variants
   ============================================ */
[data-rsl-filter][data-filter-color="success"] {
    --rsl-filter-bg-active: #10B981;
    --rsl-filter-bg-active-hover: #0d9668;
    --rsl-filter-border-active: #10B981;
    --rsl-filter-badge-bg: #10B981;
    --rsl-filter-focus-ring: rgba(16, 185, 129, 0.25);
}

[data-rsl-filter][data-filter-color="warning"] {
    --rsl-filter-bg-active: #F59E0B;
    --rsl-filter-bg-active-hover: #d97706;
    --rsl-filter-border-active: #F59E0B;
    --rsl-filter-badge-bg: #F59E0B;
    --rsl-filter-focus-ring: rgba(245, 158, 11, 0.25);
}

[data-rsl-filter][data-filter-color="danger"] {
    --rsl-filter-bg-active: #EF4444;
    --rsl-filter-bg-active-hover: #dc2626;
    --rsl-filter-border-active: #EF4444;
    --rsl-filter-badge-bg: #EF4444;
    --rsl-filter-focus-ring: rgba(239, 68, 68, 0.25);
}

[data-rsl-filter][data-filter-color="info"] {
    --rsl-filter-bg-active: #06B6D4;
    --rsl-filter-bg-active-hover: #0891b2;
    --rsl-filter-border-active: #06B6D4;
    --rsl-filter-badge-bg: #06B6D4;
    --rsl-filter-focus-ring: rgba(6, 182, 212, 0.25);
}

/* Dark Mode Color Variants - direct property overrides for active state */
/* Primary (default) - applies when no color specified or color="primary" */
[data-theme="dark"] [data-rsl-filter]:not([data-filter-color]) .rsl-filter-option[aria-pressed="true"],
[data-theme="dark"] [data-rsl-filter]:not([data-filter-color]) .rsl-filter-option.active,
[data-theme="dark"] [data-rsl-filter][data-filter-color="primary"] .rsl-filter-option[aria-pressed="true"],
[data-theme="dark"] [data-rsl-filter][data-filter-color="primary"] .rsl-filter-option.active {
    background: #6E7BFF !important;
    border-color: #6E7BFF !important;
}

[data-theme="dark"] [data-rsl-filter]:not([data-filter-color]) .rsl-filter-option:focus,
[data-theme="dark"] [data-rsl-filter][data-filter-color="primary"] .rsl-filter-option:focus {
    box-shadow: 0 0 0 3px rgba(110, 123, 255, 0.4);
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="success"] .rsl-filter-option[aria-pressed="true"],
[data-theme="dark"] [data-rsl-filter][data-filter-color="success"] .rsl-filter-option.active {
    background: #10B981 !important;
    border-color: #10B981 !important;
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="success"] .rsl-filter-option:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="warning"] .rsl-filter-option[aria-pressed="true"],
[data-theme="dark"] [data-rsl-filter][data-filter-color="warning"] .rsl-filter-option.active {
    background: #F59E0B !important;
    border-color: #F59E0B !important;
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="warning"] .rsl-filter-option:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="danger"] .rsl-filter-option[aria-pressed="true"],
[data-theme="dark"] [data-rsl-filter][data-filter-color="danger"] .rsl-filter-option.active {
    background: #EF4444 !important;
    border-color: #EF4444 !important;
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="danger"] .rsl-filter-option:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="info"] .rsl-filter-option[aria-pressed="true"],
[data-theme="dark"] [data-rsl-filter][data-filter-color="info"] .rsl-filter-option.active {
    background: #06B6D4 !important;
    border-color: #06B6D4 !important;
}

[data-theme="dark"] [data-rsl-filter][data-filter-color="info"] .rsl-filter-option:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.4);
}

/* ============================================
   Filter Groups (Multiple filters in a bar)
   ============================================ */
.rsl-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--rsl-filter-bg);
    border: 1px solid var(--rsl-filter-border);
    border-radius: calc(var(--rsl-filter-border-radius) * 1.5);
}

.rsl-filter-bar > .rsl-filter {
    flex-wrap: nowrap;
}

.rsl-filter-bar-divider {
    width: 1px;
    height: 24px;
    background: var(--rsl-filter-border);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .rsl-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .rsl-filter-bar-divider {
        width: 100%;
        height: 1px;
    }

    [data-rsl-filter][data-filter-style="buttons"] {
        flex-wrap: wrap;
    }

    [data-rsl-filter][data-filter-style="buttons"] .rsl-filter-option {
        flex: 1 1 auto;
        min-width: 80px;
    }

    .rsl-filter-dropdown {
        min-width: 100%;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .rsl-filter-option,
    .rsl-filter-dropdown-menu,
    .rsl-filter-toggle-track,
    .rsl-filter-toggle-track::after,
    .rsl-filter-summary,
    .rsl-filter-clear {
        transition: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .rsl-filter {
        display: none;
    }

    .rsl-filter-summary {
        display: block;
        background: none;
        border: 1px solid #000;
        padding: 0.5rem;
    }
}
