/* ===== КАСТОМНЫЙ SELECT ===== */

.custom-select {
  position: relative;
  z-index: 1;
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.custom-select.is-open {
  z-index: 100000;
}

/* Выбранный элемент (кнопка) */
.custom-select__selected {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  color: var(--color-text-white);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.custom-select__selected:hover {
  border-color: var(--color-primary-start);
  background: rgba(102, 126, 234, 0.05);
}

.custom-select__selected i {
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.custom-select__selected.active i {
  transform: rotate(180deg);
}

/* Выпадающий список */
.custom-select__options {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: #1a1a2e;
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.custom-select__options.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Элементы списка */
.custom-select__option {
  padding: 10px 16px;
  background: #1a1a2e;
  color: #b0b0b0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  list-style: none;
}

.custom-select__option:hover {
  background: rgba(102, 126, 234, 0.2);
  color: #ffffff;
}

.custom-select__option.selected {
  background: #667eea;
  color: white;
}

/* ===== ЗАГОЛОВКИ ГРУПП ДЛЯ РАНГОВ ===== */
.custom-select__group-title {
  font-weight: 600;
  color: #667eea;
  padding: 10px 15px 5px;
  font-size: 0.85rem;
  pointer-events: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1a2e;
  margin-top: 5px;
}

.custom-select__group-title:first-of-type {
  margin-top: 0;
}

/* Отступ для опций внутри группы */
.custom-select__option--indent {
  padding-left: 32px;
}

/* Скроллбар */
.custom-select__options::-webkit-scrollbar {
  width: 6px;
}

.custom-select__options::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.custom-select__options::-webkit-scrollbar-thumb {
  background: var(--color-primary-start);
  border-radius: 3px;
}

/* ===== СТИЛИ ДЛЯ НАТИВНОГО SELECT (запасной вариант) ===== */
.filters__select,
.form__select {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

/* Группировка для нативного select */
optgroup {
  font-weight: 600;
  color: #667eea;
  background: #1a1a2e;
  padding: 8px 0;
}

optgroup option {
  padding-left: 32px;
  font-weight: 400;
  color: #b0b0b0;
  background: #1a1a2e;
}

optgroup option:hover {
  background: rgba(102, 126, 234, 0.2);
}

.filters__select::-ms-expand,
.form__select::-ms-expand {
  display: none;
}

/* ===== ГРУППЫ РАНГОВ В ПРОФИЛЕ ===== */
.rank-mode-group {
  margin-bottom: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-mode-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-mode-name {
  font-weight: 600;
  color: #667eea;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-mode-name i {
  font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 768px) {
  .custom-select__selected {
    font-size: 0.9rem;
  }

  .custom-select__option {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .rank-mode-group {
    padding: 10px;
  }
}

@media (max-width: 576px) {
  .custom-select__selected {
    font-size: 0.85rem;
  }

  .custom-select__options {
    max-height: 200px;
  }
}