.llm-selector {
  position: relative;
  width: 100%;

  border-radius: 6px;

  .selector-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: default;
  }

  .selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-nodes-input-bg);
    border: 1px solid var(--color-divider-subtle);
    border-radius: 6px;
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;

    &:hover {
      border-color: rgba(255, 255, 255, 0.2);
    }

    &:focus-within,
    &.open {
      border-color: var(--accent-color);
    }

    &.disabled {
      opacity: 0.5;
      cursor: not-allowed;

      &:hover {
        border-color: var(--color-divider-subtle);
      }
    }

    &.loading {
      opacity: 0.7;
      cursor: wait;
    }

    .selected-llm {
      flex: 1;
      min-width: 0;

      .placeholder {
        color: rgba(255, 255, 255, 0.3);
      }

      .selected-text {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;

        .model-name {
          font-weight: 500;
          color: #fff;
          line-height: 1.2;
        }

        .config-name {
          font-size: 0.75rem;
          color: rgba(255, 255, 255, 0.6);
          line-height: 1.2;
        }
      }
    }

    .selector-arrow {
      display: flex;
      align-items: center;
      margin-left: 0.5rem;
      color: rgba(255, 255, 255, 0.6);
      transition: transform 0.2s ease, color 0.2s ease;
      font-size: 1rem;

      &.open {
        transform: rotate(180deg);
        color: var(--accent-color);
      }
    }
  }

  .dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: var(--color-nodes-sidepanel-bg);
    border: 1px solid var(--color-divider-subtle);
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0;

    .dropdown-item {
      padding: 0.5rem 0.75rem;
      color: #fff;
      font-size: 0.875rem;
      cursor: pointer;
      transition: background-color 0.2s ease;
      border-radius: 4px;
      margin: 0 0.25rem;

      &:hover {
        background-color: rgba(255, 255, 255, 0.05);
      }

      &.selected {
        background-color: var(--accent-color);
        color: #202020;
        font-weight: 500;

        .config-name {
          color: rgba(32, 32, 32, 0.7);
        }
      }

      .option-text {
        color: rgba(255, 255, 255, 0.6);
        font-style: italic;
      }

      .model-name {
        display: block;
        font-weight: 500;
        line-height: 1.2;
      }

      .config-name {
        display: block;
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.6);
        line-height: 1.2;
        margin-top: 0.125rem;
      }
    }
  }
}

// Custom scrollbar for dropdown
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

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

.dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
