/* Стили для улучшенных фильтров */

.enhanced-filter-group {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.enhanced-filter-group .filter-header {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 10px 12px 8px;
}

.enhanced-filter-group .filter-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.enhanced-filter-group .filter-search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    background: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.enhanced-filter-group .filter-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.enhanced-filter-group .filter-search::placeholder {
    color: #6c757d;
    font-size: 12px;
}

.enhanced-filter-group .filter-dropdown {
    max-height: 160px; /* ~5 опций */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ced4da #f8f9fa;
}

/* Webkit scrollbar styling */
.enhanced-filter-group .filter-dropdown::-webkit-scrollbar {
    width: 6px;
}

.enhanced-filter-group .filter-dropdown::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.enhanced-filter-group .filter-dropdown::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.enhanced-filter-group .filter-dropdown::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.enhanced-filter-group .filter-options-container {
    padding: 4px 0;
}

.enhanced-filter-group .enhanced-filter-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.15s ease;
    font-size: 13px;
    user-select: none;
}

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

.enhanced-filter-group .enhanced-filter-option:hover {
    background-color: #f8f9fa;
}

.enhanced-filter-group .enhanced-filter-option.selected {
    background-color: #e3f2fd;
}

.enhanced-filter-group .enhanced-filter-option.selected:hover {
    background-color: #bbdefb;
}

.enhanced-filter-group .enhanced-filter-option input[type="checkbox"],
.enhanced-filter-group .enhanced-filter-option input[type="radio"] {
    margin: 0 8px 0 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.enhanced-filter-group .enhanced-filter-option .option-text {
    flex: 1;
    color: #495057;
    font-weight: 500;
}

.enhanced-filter-group .enhanced-filter-option .option-count {
    color: #6c757d;
    font-size: 12px;
    font-weight: normal;
    margin-left: 6px;
}

.enhanced-filter-group .enhanced-filter-option.selected .option-text {
    color: #1976d2;
    font-weight: 600;
}

.enhanced-filter-group .enhanced-filter-option.selected .option-count {
    color: #1976d2;
}

.enhanced-filter-group .no-options {
    padding: 16px 12px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
}

.enhanced-filter-group .filter-selected-count {
    background: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 8px 12px;
    font-size: 12px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.enhanced-filter-group .filter-selected-count .count {
    font-weight: 600;
    color: #007bff;
}

.enhanced-filter-group .clear-selection-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.enhanced-filter-group .clear-selection-btn:hover {
    background: #c82333;
}

.enhanced-filter-group .clear-selection-btn:active {
    background: #bd2130;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .enhanced-filter-group {
        margin-bottom: 8px;
    }

    .enhanced-filter-group .filter-header {
        padding: 8px 10px 6px;
    }

    .enhanced-filter-group .filter-title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .enhanced-filter-group .filter-search {
        padding: 5px 8px;
        font-size: 12px;
    }

    .enhanced-filter-group .enhanced-filter-option {
        padding: 6px 10px;
        font-size: 12px;
    }

    .enhanced-filter-group .enhanced-filter-option input[type="checkbox"],
    .enhanced-filter-group .enhanced-filter-option input[type="radio"] {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }

    .enhanced-filter-group .filter-selected-count {
        padding: 6px 10px;
        font-size: 11px;
    }

    .enhanced-filter-group .clear-selection-btn {
        padding: 3px 6px;
        font-size: 10px;
    }
}

/* Анимации */
.enhanced-filter-group .enhanced-filter-option {
    transform: translateY(0);
    transition: all 0.15s ease;
}

.enhanced-filter-group .enhanced-filter-option:active {
    transform: translateY(1px);
}

/* Фокус для доступности */
.enhanced-filter-group .enhanced-filter-option:focus-within {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

/* Состояние загрузки */
.enhanced-filter-group.loading {
    opacity: 0.6;
    pointer-events: none;
}

.enhanced-filter-group.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

/* Индикатор активных фильтров */
.enhanced-filter-group.has-selection .filter-header {
    background: #e3f2fd;
    border-color: #1976d2;
}

.enhanced-filter-group.has-selection .filter-title {
    color: #1976d2;
}