

.custom-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 170px;
  font-family: var(--font-main);
}

.custom-dropdown.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.custom-dropdown-selected {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
  border: 2px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
  min-height: 48px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.custom-dropdown-selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.1), 
    transparent);
}

.custom-dropdown:not(.disabled) .custom-dropdown-selected:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.custom-dropdown.open .custom-dropdown-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
  box-shadow: 0 0 0 3px var(--accent-glow),
              0 8px 24px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.custom-dropdown.disabled .custom-dropdown-selected {
  cursor: not-allowed;
}

.custom-dropdown-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-arrow {
  font-size: 11px;
  color: var(--accent);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255, 200, 87, 0.3));
}

.custom-dropdown.open .custom-dropdown-arrow {
  transform: rotate(180deg);
}


.custom-dropdown-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, 
    rgba(20, 20, 20, 0.98), 
    rgba(15, 15, 15, 0.98));
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 1000;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-dropdown-options.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.custom-dropdown-options.open-upward {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(10px) scale(0.98);
}

.custom-dropdown-options.open-upward.active {
  transform: translateY(0) scale(1);
}


.custom-dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  border-left: 3px solid transparent;
  margin: 2px 4px;
  border-radius: 8px;
}

.custom-dropdown-option:first-child {
  margin-top: 6px;
}

.custom-dropdown-option:last-child {
  margin-bottom: 6px;
}

.custom-dropdown-option:hover:not(.disabled) {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.08), 
    rgba(255, 255, 255, 0.05));
  color: var(--text);
  border-left-color: var(--accent);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-dropdown-option.selected {
  background: linear-gradient(90deg, 
    rgba(255, 200, 87, 0.15), 
    rgba(255, 200, 87, 0.08));
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 200, 87, 0.2);
}

.custom-dropdown-option.selected::before {
  content: '✓';
  position: absolute;
  right: 16px;
  color: var(--accent);
  font-weight: bold;
  font-size: 16px;
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.5);
}

.custom-dropdown-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


.custom-dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.custom-dropdown-options::-webkit-scrollbar-track {
  background: transparent;
}

.custom-dropdown-options::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}




.custom-dropdown.dropdown-sm .custom-dropdown-selected {
  padding: 8px 12px;
  font-size: 13px;
  min-height: 36px;
}

.custom-dropdown.dropdown-sm .custom-dropdown-option {
  padding: 8px 12px;
  font-size: 13px;
}


.custom-dropdown.dropdown-lg .custom-dropdown-selected {
  padding: 12px 16px;
  font-size: 15px;
  min-height: 48px;
}

.custom-dropdown.dropdown-lg .custom-dropdown-option {
  padding: 12px 16px;
  font-size: 15px;
}


.custom-dropdown.dropdown-primary .custom-dropdown-selected {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

.custom-dropdown.dropdown-primary .custom-dropdown-arrow {
  color: #000;
}

.custom-dropdown.dropdown-primary:not(.disabled) .custom-dropdown-selected:hover {
  opacity: 0.9;
}


.setting-row .custom-dropdown {
  min-width: 170px;
  max-width: 250px;
}


.model-select .custom-dropdown {
  width: 100%;
}


@media (max-width: 600px) {
  .custom-dropdown-options {
    max-height: 200px;
  }
  
  .custom-dropdown {
    min-width: 140px;
  }
}


@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.custom-dropdown-option {
  animation: slideIn 0.2s ease forwards;
}

.custom-dropdown-option:nth-child(1) { animation-delay: 0s; }
.custom-dropdown-option:nth-child(2) { animation-delay: 0.02s; }
.custom-dropdown-option:nth-child(3) { animation-delay: 0.04s; }
.custom-dropdown-option:nth-child(4) { animation-delay: 0.06s; }
.custom-dropdown-option:nth-child(5) { animation-delay: 0.08s; }
.custom-dropdown-option:nth-child(n+6) { animation-delay: 0.1s; }


.custom-dropdown-selected:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.custom-dropdown-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}


.custom-dropdown.loading .custom-dropdown-arrow {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


.custom-dropdown-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}


.custom-dropdown-group {
  padding: 8px 14px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  border-bottom: 2px solid rgba(255, 200, 87, 0.2);
  margin-bottom: 4px;
  position: relative;
}

.custom-dropdown-group::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent,
    var(--accent),
    transparent);
  box-shadow: 0 0 8px rgba(255, 200, 87, 0.4);
}

.custom-dropdown-group:first-child {
  border-top: none;
}


.custom-dropdown-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  z-index: 1;
}

.custom-dropdown-search input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.custom-dropdown-search input:focus {
  border-color: var(--accent);
}

.custom-dropdown-search input::placeholder {
  color: var(--text-dim);
}
