/* Фильтры для Finder */
.filters-popup {
    display: flex;
    padding: inherit;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.filters-popup {
    opacity: 0;
    transform: scale(0.65);
    transition: opacity 0.15s cubic-bezier(0, 0, 0.56, 1.05), transform 0.15s cubic-bezier(0, 0, 0.57, 1.06);
    pointer-events: none;
}

    .filters-popup.active {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

.filters-container {
    background: var(--spacer-color, #22222270);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 22rem;
    /* max-height: 90dvh; */
    overflow-y: auto;
    position: relative;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #333);
}

.filters-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0;
}

.filters-close {
    background: none;
    border: none;
    color: var(--text-secondary, #999);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .filters-close:hover {
        background: var(--hover-bg, #333);
        color: var(--text-primary, #fff);
    }

/* Предупреждение о подписке */
.subscription-warning {
    background: var(--block-color);
    color: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    font-size: 0.8rem;
}

    .subscription-warning .warning-icon {
        font-size: 1.2rem;
        margin-right: 8px;
    }

/* Секции фильтров */
.filter-section {
    margin-bottom: 1rem;
}

.filter-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

/* Гендер */
.gender-options {
    display: flex;
    gap: 12px;
    height: 7rem;
    margin-top: 0.6rem;
}

.gender-option {
    flex: 1;
    position: relative;
}

    .gender-option input[type="radio"] {
        display: none;
    }

/*    .gender-option label {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
        border: 2px solid var(--border-color, #333);
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-weight: 500;
        color: var(--text-secondary, #999);
    }

    .gender-option input[type="radio"]:checked + label {
        border-color: var(--primary-color, #007bff);
        background: var(--primary-color, #007bff);
        color: var(--background-color);
    }*/

/* Возраст */
.age-slider-container {
    padding: 0 8px;
    position: relative;
    /*    height: 60px;*/
}

.age-range {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary, #999);
}

.slider-track {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

.age-slider {
    position: absolute;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

    .age-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--primary-color, #007bff);
        cursor: pointer;
        border: 2px solid var(--card-bg, #1a1a1a);
        pointer-events: all;
    }

    .age-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--primary-color, #007bff);
        cursor: pointer;
        border: 2px solid var(--card-bg, #1a1a1a);
        pointer-events: all;
    }

.age-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
}

/* Часовой пояс */
.timezone-slider-container {
    padding: 0 8px;
    position: relative;
    /*    height: 60px;*/
}

.timezone-range {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary, #999);
}

.timezone-slider {
    position: absolute;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

    .timezone-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--primary-color, #007bff);
        cursor: pointer;
        border: 2px solid var(--card-bg, #1a1a1a);
        pointer-events: all;
    }

    .timezone-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--primary-color, #007bff);
        cursor: pointer;
        border: 2px solid var(--card-bg, #1a1a1a);
        pointer-events: all;
    }

.timezone-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
}

/* Игры */
.filter-games-selector {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.filter-games-button {
    width: fit-content;
    padding: 5px 16px;
    background: var(--primary-color, #007bff);
    color: var(--background-color);
    border: none;
    border-radius: 30rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .filter-games-button:hover {
        background: var(--accent-hover, #0056b3);
    }

.selected-filter-games-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.selected-filter-game-tag {
    background: var(--primary-color, #007bff);
    color: var(--background-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Popup для выбора игр */
.filter-games-popup {
    padding: inherit;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1100;
    display: none;
    justify-content: center;
    align-items: center;
}

    .filter-games-popup.active {
        display: flex;
    }

.filter-games-popup-container {
    background: var(--card-bg, #1a1a1a);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 90dvh;
    overflow-y: auto;
}

.filter-games-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #333);
}

.filter-games-popup-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0;
}

.filter-games-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary, #999);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .filter-games-popup-close:hover {
        background: var(--hover-bg, #333);
        color: var(--text-primary, #fff);
    }

.filter-games-search {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    color: var(--text-primary, #fff);
    font-size: 1rem;
    margin-bottom: 16px;
}

    .filter-games-search::placeholder {
        color: var(--text-secondary, #999);
    }

.filter-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.filter-game-item {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: var(--border-color);
    display: flex;
    align-content: center;
    justify-content: center;
    align-items: center;
}

    .filter-game-item:hover {
        transform: translateY(-2px);
    }

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

    .filter-game-item label {
        /* width: 100%; */
        /* height: 100%; */
        display: block;
        padding: 12px 8px;
        text-align: center;
        /* background: var(--input-bg, #2a2a2a); */
        border: 2px solid transparent;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--primary-color);
    }

    .filter-game-item:has(input[type="checkbox"]:checked) {
        border-color: var(--background-color);
        background: var(--border-color);
        color: white;
        filter: brightness(1.5);
    }

/* Кнопки действий */
.filters-actions {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
}

.filters-reset {
    flex: 1;
    padding: 5px 16px;
    background: var(--input-bg, #2a2a2a);
    color: var(--text-secondary, #999);
    border: 1px solid var(--border-color, #333);
    border-radius: 30rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .filters-reset:hover {
        background: var(--hover-bg, #333);
        color: var(--text-primary, #fff);
    }

.filters-apply {
    flex: 1;
    padding: 5px 16px;
    background: var(--primary-color, #007bff);
    color: var(--background-color);
    border: none;
    border-radius: 30rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .filters-apply:hover {
        filter: brightness(1.2);
    }

/* Неактивные фильтры */
.filters-disabled {
    /*    opacity: 0.5;*/
    pointer-events: none !important;
}

    .filters-disabled .filter-section {
        opacity: 0.5;
    }

/* Стили для трека слайдера */
.slider-track {
    margin-top: 1rem;
    background: var(--primary-color);
    height: 4px;
    border-radius: 2px;
    position: relative;
}

/* Адаптивность */
@media (max-width: 480px) {
    .filters-container,
    .filter-games-popup-container {
        width: 95%;
        padding: 20px;
    }

    .filter-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .filter-game-item label {
        padding: 10px 6px;
        font-size: 0.85rem;
    }
}
