/* Боковая панель с фильтрами */
.sidebar {
    width: 300px;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    transition: transform 0.3s ease;
    z-index: 1000;
    margin-top: 120px;
}

/* Левый блок с фильтрами */
.sidebar-filters {
    width: 250px;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

/* Правый блок с кнопкой */
.sidebar-toggle {
    width: 50px;
    background-color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    border-left: 1px solid #34495e;
}

.sidebar-toggle:hover {
    background-color: #34495e;
}

/* Стили для фильтров */
.sidebar-filters label {
    display: block;
    margin: 0 0 5px;
    font-weight: bold;
    color: white;
}

.sidebar-filters select,
.sidebar-filter-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background-color: #34495e;
    color: white;
    box-sizing: border-box;
}

.sidebar-filter-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Контейнер для пинга */
.sidebar-filters .ping-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sidebar-filters .ping-container label {
    margin: 0;
}

.sidebar-filters .ping-value {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Ползунок пинга */
.sidebar-filters input[type="range"] {
    width: 95%;
    margin-bottom: 15px;
}

/* Стили для заголовков секций */
.section-title {
    padding-top: 10px;
    border-top: 1px solid #34495e;
    display: block;
    margin: 0 0 5px;
    font-weight: bold;
    color: white;
}

/* Стили для блока сортировки */
.sorting-controls {
    margin-bottom: 20px;
}

.sorting-row label {
    display: block;
    color: #fff;
}

.sort-select-wrapper {
    position: relative;
    display: flex;
}

.sort-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #34495e;
    border-radius: 4px 0 0 4px;
    background-color: #34495e;
    color: white;
    appearance: none;
    flex-grow: 1;
}

.sort-direction-btn {
    width: 34px;
    height: 34px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

.sort-direction-btn:hover {
    background-color: #34495e;
}

.sort-select::-ms-expand {
    display: none;
}

.sort-number {
    padding: 8px;
}

/* Стили для кастомного multiselect */
.custom-multiselect {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 13.33px;
}

.custom-multiselect-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background-color: #34495e;
    color: white;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    font: inherit;
}

/* Стили для поля поиска в выпадающем списке */
.dropdown-search {
    padding: 8px 10px;
    border-bottom: 1px solid #34495e;
    position: sticky;
    top: 0;
    background: #2c3e50;
    z-index: 101;
}

.dropdown-search input {
    width: 90%;
    padding: 5px;
    background: #34495e;
    border: 1px solid #456;
    border-radius: 3px;
    color: white;
    outline: none;
}

.dropdown-search input::placeholder {
    color: #aaa;
}

.custom-multiselect-dropdown {
    padding-top: 0;
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: #2c3e50;
    border: 1px solid #34495e;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font: inherit;
}

/* Стили для списка, раскрывающегося вниз */
.custom-multiselect-dropdown.dropdown-down {
    top: 100%;
    bottom: auto;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* Стили для списка, раскрывающегося вверх */
.custom-multiselect-dropdown.dropdown-up {
    top: auto;
    bottom: 100%;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.sidebar-filters .custom-multiselect-option label {
    font-weight: normal;
    margin: 0px;
}

.custom-multiselect-option {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font: inherit;
}

.custom-multiselect-option:hover {
    background-color: #34495e;
}

.custom-multiselect-option input {
    margin-right: 8px;
}

.custom-multiselect-placeholder {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
}

.custom-multiselect-arrow {
    margin-left: 8px;
    font-size: 12px;
}

#steam-switch-div {
    margin-bottom: 15px;
}

/* Управление видимостью фильтров */
#computers-filters {
    display: none;
    height: calc(100vh - 450px); /* 100% высоты экрана минус 400px */
    max-height: 100vh; /* На случай, если 400px > 100vh */
}

.computers-view #computers-filters {
    display: block;
}

#games-filters {
    display: none;
    height: calc(100vh - 450px); /* 100% высоты экрана минус 400px */
    max-height: 100vh; /* На случай, если 400px > 100vh */
}

.games-view #games-filters {
    display: block;
}

#last-selection-text {
    font-size: smaller;
    line-height: 1.5;
    max-height: 200px;
    overflow: hidden;
}

#last-selection-text b {
    text-decoration: underline dotted;
}

#last-selection-accept {
    margin-top: 0;
}

/* The switch - the box around the slider */
.steam-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height:  28px;
}

/* Hide default HTML checkbox */
.steam-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.steam-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.steam-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

.steam-text {
    position: absolute;
    left: 54px;
    white-space: nowrap;
    top: 10px;
}

input:checked + .steam-slider {
    background-color: #2196F3;
}

input:focus + .steam-slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .steam-slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

/* Rounded sliders */
.steam-slider {
    border-radius: 28px;
}

.steam-slider:before {
    border-radius: 50%;
}