/* SelectWithSearch — тёмная тема DomPro */

.select-with-search {
  position: relative;
  width: 100%;
}

.sws-control {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-elevated, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: var(--radius-sm, 8px);
  padding: 0 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sws-control:focus-within {
  border-color: #d4af37;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

.sws-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary, #f1f5f9);
  font: inherit;
  padding: 0.55rem 0.25rem;
  min-width: 0;
}

.sws-input:focus {
  outline: none;
}

.sws-clear {
  border: none;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.sws-clear:hover {
  color: #ef4444;
}

.sws-chevron {
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  pointer-events: none;
}

.sws-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-color, #334155);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-height: 300px;
  overflow-y: auto;
  animation: sws-fade-in 0.15s ease;
}

@keyframes sws-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sws-group {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-gold, #d4af37);
  font-weight: 600;
}

.sws-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-primary, #f1f5f9);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.sws-option:hover,
.sws-option.active {
  background: rgba(212, 175, 55, 0.12);
}

.sws-option mark {
  background: rgba(212, 175, 55, 0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.sws-option-title {
  display: block;
  font-weight: 500;
}

.sws-option-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.15rem;
}

.sws-empty {
  padding: 0.75rem;
  color: var(--text-muted, #94a3b8);
  font-size: 0.875rem;
}

.sws-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 499;
}

.sws-dropdown--mobile {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  top: auto;
  max-height: 70vh;
  z-index: 501;
}

/* Auth / style.css pages */
.auth-page .select-with-search .sws-control {
  background: #fff;
  border-color: #d1d5db;
}

.auth-page .select-with-search .sws-input {
  color: #111827;
}

.auth-page .select-with-search .sws-dropdown {
  background: #fff;
  border-color: #d1d5db;
}

.auth-page .select-with-search .sws-option {
  color: #111827;
}

@media (max-width: 768px) {
  .sws-dropdown:not(.sws-dropdown--mobile) {
    max-height: 240px;
  }
}
